Scinovex
article Open Access

Forecasting wholesale castor prices in Andhra Pradesh with hybrid, machine learning and wavelet decomposition techniques

Abstract

Castor (Ricinus communis L.) is an important oilseed crop in Andhra Pradesh, contributing significantly to India's economy through oil exports. Although it has been cultivated for a long time, castor accounts for only a small portion of global vegetable oil production. Its oil is crucial in the chemical industry as the sole commercial source of hydroxylated fatty acids. Accurate forecasting of wholesale castor prices is vital for stakeholders to manage risks effectively. For this purpose, secondary data on castor prices in Andhra Pradesh from 2008-2024 was analyzed using autocorrelation with the Box-Pierce test. Various machine learning models were developed, including ARIMA, ANN, SVR, ELM, hybrids combining these methods and wavelet decomposition models. The ARIMA+ELM model demonstrated the best predictive accuracy, aiding in better price forecasting and contributing to market stability and economic efficiency in agriculture.

Full Text

Tables and figures are in the full-text PDF.

Introduction

Castor (Ricinus communis L.) is a significant industrial oilseed crop cultivated primarily for its high-value castor oil, which finds extensive applications in the pharmaceutical, cosmetic, lubricant, and biofuel industries. India is the leading producer and exporter of castor seeds globally, with Andhra Pradesh emerging as one of the major contributing states, particularly in districts like Kurnool, Anantapur, and Prakasam. The crop plays a vital role in the agrarian economy, especially in dryland farming systems, due to its resilience under arid and semi-arid conditions. In recent years, castor prices have exhibited substantial volatility, influenced by factors such as fluctuations in global demand, speculative trading, climate variability, and policy interventions. Such price instability poses a serious challenge to both farm-level decisionmaking and market planning, impacting the livelihoods of thousands of smallholder farmers in Andhra Pradesh who rely on castor cultivation for income. Given this context, accurate and timely forecasting of castor prices is crucial for enabling farmers, traders, and policymakers to make informed decisions. Traditional linear forecasting models often fall short in capturing the complex, nonlinear, and non-stationary patterns inherent in agricultural price time series. This necessitates the adoption of advanced forecasting techniques that can model both short-term fluctuations and long-term trends effectively. To address this need, the present study explores a hybrid forecasting approach, Wavelet Decomposition and Machine Learning models, aiming to enhance the accuracy of price predictions by decomposing complex signals and leveraging data-driven learning capabilities. The study specifically focuses on forecasting monthly castor prices in Andhra Pradesh, providing insights into market behaviour and aiding in the development of early warning systems for agricultural stakeholders.

Materials and Methods

The data for this study were sourced from India stat and AGMARKNET, covering the period from January 2008 to December 2024 i.e. 17 years data (monthly data) and this study was carried out in 2025 in S. V. Agricultural College, Tirupati. The dataset consists of monthly average prices (in INR per quintal) in Andhra Pradesh. The dataset contains 204 observations. Out of the 204 data points 192 data points were taken as train and the rest 12 i.e. from 193-204 data points were taken as test. The Following methodology was carried out in R Studio.

Methodology

In this study, we employed wavelet analysis to investigate the underlying patterns and structures in the time series data of castor prices, enabling us to decompose the price fluctuations into different frequency components. This approach allowed us to effectively capture both short-term volatility and longterm trends, enhancing the accuracy of our forecasting models and providing valuable insights into price dynamics in the agricultural market. The wavelet transform offers a flexible framework for decomposing non-stationary time series data into localized frequency components, allowing for a detailed analysis of both low-frequency trends and high-frequency fluctuations. This approach use can be found in Paul et al. (2021) [17] .

Wavelet Filter Selection

We utilized the Daubechies wavelet filter, specifically the la8 filter, characterized by eight vanishing moments. The choice of the la8 wavelet is informed by its ability to effectively capture essential features of the signal while maintaining a balance between temporal and frequency localization. This filter is particularly suitable for our analysis as it provides significant smoothing properties and is computationally efficient for time series data.

Wavelet Transform Approach

To perform the wavelet, transform, we applied the Discrete Wavelet Transform (DWT) rather than the Maximal Overlap Discrete Wavelet Transform (MODWT). The DWT was selected to ensure a straightforward implementation and to facilitate the analysis of the signal at discrete scales. Implementation: The wavelet transform was executed using the wt. Filter function in R, with parameters set as follows:  Filter: Filter = "la8"  MODWT: modwt = FALSE  Level of Decomposition: Level = 1 This configuration allowed for the initial decomposition of the time series data into two primary components: the approximation coefficients, which capture the low-frequency trends, and the detail coefficients, which represent the highfrequency variations.

ARIMA (Autoregressive Integrated Moving Average)

The application of this procedure can be seen in Jadhav et al. (2017) [11] . ARIMA is a popular statistical model used for forecasting time series data. It combines three components: AR (Autoregressive): Uses the relationship between an observation and a number of lagged observations (previous time steps).  I (Integrated): Differencing the raw observations to allow for the time series to become stationary.

 MA (Moving Average): Uses the relationship between an observation and a residual error from a moving average model applied to lagged observations.

ARIMA Model Specification

The ARIMA model is denoted as ARIMA (p, d, q)

Where, P: Number of lag observations (AR term) D: Number of times that the raw observations are differenced (I term) q: Size of the moving average window (MA term)

Formula

The ARIMA model can be expressed as

ANN (Artificial Neural Networks)

Artificial Neural Networks (ANNs) are sophisticated computational models that draw inspiration from the neural networks of the human brain. These networks are made up of interconnected nodes, commonly referred to as neurons, which are arranged in layers: an input layer, one or more hidden layers, and an output layer. ANNs excel at identifying and modeling complex nonlinear relationships within data, making them valuable tools in various fields such as machine learning, data analysis, and artificial intelligence. The application of ANN can be found in Paul et al. (2020) [24] .

Architecture

 Input Layer: Receives input features.

 Hidden Layer(s): Processes inputs with activation functions to learn patterns.  Output Layer: Produces the forecasted output.

Training

ANNs are trained using a dataset by adjusting the weights and biases through a process called back propagation, minimizing the difference between predicted and actual outputs.

Formula

For a single-layer feed forward ANN, the output Y can be computed as:

Where, 𝑌 is the output of the neuron. 𝑋 𝑖 are the input features. 𝑤 𝑖 are the weights associated with the inputs. 𝑏 is the bias term. 𝑓 is the activation function (e.g., sigmoid, ReLU).

Support Vector Regression (SVR)

Support Vector Regression (SVR), the supervised learning algorithm is used to predict discrete values. SVR's main aim is to locate the line of best fit. The best-fit line in SVR is the hyperplane with the maximum number of points. The SVR, unlike other regression models, aims to fit the best line inside a threshold value, rather than minimizing the error between the real and projected value. Fitting of Support Vector regression 𝑓(𝑋) = 𝛽 0 + 𝛽 1 𝑋 1 + ⋯ + 𝛽 𝑝 𝑋 𝑝 can be expressed as Minimize

The principal idea involved in SVR is to transform the original input space into high-dimensional variable space and then build the regression or time series model in a transformed high-dimensional feature space. A vector of data set says 𝑍 = {𝑥 𝑖 𝑦 𝑖 } 𝑖=1 𝑁 , where 𝑥 𝑖 ∈ 𝑅 𝑛 is the input vector, 𝑦 𝑖 is the scalar output, and N is the size of the data set. The general equation SVR can be written as follows:

Where W is the weight vector, b is the bias term, and superscript T denotes the transpose.

Extreme Learning Machine (ELM)

Extreme Learning Machine (ELM) is a machine learning algorithm that offers a fast and efficient approach for training single-hidden-layer feed forward neural networks. It was introduced by Huang, Huang, and Song in 2006 as an alternative to traditional iterative optimization algorithms like back propagation.

The training process of ELM involves the following steps:

1. Input Layer: The input layer receives the feature vectors or data points. 2. Hidden Layer: The hidden layer consists of randomly assigned weights connecting the inputs to the hidden neurons. 3. Activation Function: Each hidden neuron applies an activation function (e.g., sigmoid, radial basis function, or ReLU) to the weighted sum of its inputs. 4. Output Layer: The outputs of the hidden layer are linearly combined using a least-squares regression algorithm to obtain the output weights. This step involves solving a system of linear equations.

A series of models were developed to predict groundnut prices based on historical price data. The models applied in this research include:  Wavelet-ARIMA: A combination of wavelet decomposition and ARIMA for forecasting both trend and seasonal components of time series data. The application of this approach can be seen in Kriechbaumer et al. (2014) [14] .  Wavelet-ANN: It involves decomposing the time series into different frequency components using wavelet transform, training separate artificial neural networks on each component, and then reconstructing the forecasted series through inverse wavelet transform to capture both linear and nonlinear patterns for improved accuracy. The application of this approach can be seen in Paul et al.

(2022) [19] .  Artificial Neural Networks (ANN): A machine learning model designed to capture complex nonlinear relationships.

 Support Vector Regression (SVR): A robust machine learning technique based on Support Vector Machines (SVM), designed to perform regression tasks by finding an optimal hyperplane that minimizes generalization error, making it effective for handling high-dimensional and nonlinear data. For this particular data radial basis function was used.  Extreme Learning Machine (ELM): A feed forward neural network model with a single hidden layer, where input weights and biases are randomly assigned and output weights are analytically determined, enabling extremely fast learning and good generalization for nonlinear regression problems. In this sigmoid activation function was used  Hybrid ARIMA+ANN: This approach integrates ARIMA (Autoregressive Integrated Moving Average) for forecasting linear patterns while utilizing Artificial Neural Networks (ANN) to model the nonlinear residuals. This combination allows for a more comprehensive analysis, effectively addressing both linear trends and complex, nonlinear behaviors in the data. This hybrid approach was witnessed in Zhang (2003) [29] .

𝑁

Where 𝑦 𝑖 and 𝑦 𝑖 ̂are the actual and predicted values of response variable, respectively.

Mean Square Error (MSE)

Measures the average squared differences between actual and predicted values Formula: 𝑀𝑆𝐸 = ∑ (𝑦 𝑖 -𝑦 𝑖 ̂)2 𝑁 𝑖=1

𝑁

Where 𝑦 𝑖 and 𝑦 𝑖 ̂are the actual and predicted values of response variable, respectively.

Mean absolute percentage error (MAPE)

The mean absolute percentage error (MAPE) is one of the most popular measures of the forecast accuracy.

𝐴 𝑡 and 𝐹 𝑡 note the actual and forecast values at data point t, respectively.

Results and Discussion

The wholesale castor prices in Andhra Pradesh showed an average price of ₹3890.70 and a median of ₹3592, indicating a moderate right-skew in the distribution (skewness = 0.7157). The mode was ₹2329, significantly lower than the mean and median. The standard deviation of ₹1121.62 reflects notable variability, while the coefficient of variation (28.83%) indicates moderate relative variability. Prices ranged from a minimum of ₹2037 to a maximum of ₹6873, with a wide range of ₹4836 and an interquartile range of ₹1450.75. Overall, castor prices displayed moderate variability with a tendency for higher extremes. In this study, we implemented various modeling techniques to analyze the data and enhance prediction accuracy. Firstly, we applied the ARIMA model using the auto.arima() function in R. This analysis identified the optimal ARIMA model as (0, 1, 0), which was determined based on the lowest Akaike Information Criterion (AIC). However, subsequent testing with the Box-Pierce test and BDS test revealed the presence of autocorrelation and non-linearity in the residuals of the ARIMA model, suggesting that it may not fully capture the underlying dynamics of the data. To address these limitations, we then employed an Artificial Neural Network (ANN) model on the training dataset. This model comprised 12 input nodes, 2 hidden nodes in a single hidden layer, and one output node, utilizing the NNETAR function from the forecast package in R. Despite improvements, the residuals from the ANN model also indicated autocorrelation and non-linearity, highlighting the complexity of the data structure.

Next, we constructed a Support Vector Regression (SVR) model, which was fine-tuned with specific parameters: a cost parameter of 7, a gamma value of 0.6, and an epsilon margin of 0.01. These parameters were carefully selected to balance model complexity with tolerance for error, thereby enhancing the model's predictive capabilities while mitigating the risk of over fitting. Furthermore, we applied an Extreme Learning Machine (ELM) model comprising 300 hidden neurons, each initialized with uniform negative weights. The input weights, biases for the hidden layer, and output weights were structured as numeric vectors of length 300, corresponding to the number of hidden nodes. The activation function utilized in this model was the sigmoid function, which is known for its effectiveness in neural network applications. Building on these individual models, we also explored Wavelet models, which provide a robust approach for handling non-stationary data. Finally, Hybrid models were employed to combine the strengths of the aforementioned techniques, aiming to achieve even higher accuracy in the predictions. Through this comprehensive modelling approach, we aimed to effectively capture the complexities of the data and improve forecasting performance.

Figure 1 illustrates the discrete wavelet decomposition of the original time series, separating it into approximation and detail components across multiple resolution levels. The lower panel presents the original time series, while the upper panels depict the detail coefficients (W₁ to W₇) and the approximation component (V₇), effectively highlighting features present at various time scales. Among the explored models, the combinations of ARIMA with Support Vector Regression (SVR) and ARIMA with Extreme Learning Machine (ELM) displayed suboptimal performance metrics, particularly regarding RMSE, MSE, and MAPE. Notably, the ARIMA+ELM hybrid model exhibited superior performance relative to the other evaluated models, achieving the lowest training performance metrics, reflecting its high accuracy and stability in predictions. When compared to all other evaluated models, ARIMA+ELM consistently delivers enhanced precision, indicating that the integration of ARIMA's linear modelling approach with ELM's nonlinear learning capabilities adeptly captures the underlying structure of the dataset. The predicted values for castor prices in 2025, as obtained from the ARIMA+ELM model, are presented in Table 3, showing a strong alignment with the actual market prices. Graph 1 further illustrates the accuracy of the forecasts by depicting the actual versus predicted values for 2025, where the predicted price series closely tracks the actual price movements. This result reaffirms the effectiveness of the ARIMA+ELM model in capturing both long-term price trends and short-term market fluctuations, making it a valuable tool for stakeholders in the agricultural sector, including farmers, traders, and policymakers, to make informed market decisions. A comparative analysis of the forecasting models for castor price prediction highlights the ARIMA + ELM approach as the most accurate.

Conclusion

This study demonstrates the effectiveness of hybrid forecasting models, particularly the ARIMA + ELM approach, for predicting the volatile prices of castor in Andhra Pradesh. Through comprehensive analysis, we have shown that combining ARIMA's ability to model linear trends with ELM's proficiency in handling nonlinear relationships results in significantly improved forecasting accuracy. The ARIMA + ELM model outperformed other models, achieving the lowest RMSE and MAPE across both training and testing datasets, highlighting its robustness in capturing both longterm price trends and short-term fluctuations.

The study also revealed that traditional models such as ARIMA and ANN alone were less effective in capturing the complexity and volatility inherent in agricultural price data, while hybrid model ARIMA + ANN and machine learning model like SVR showed improvements but did not surpass the performance of ARIMA + ELM. Furthermore, the successful application of the Box-Pierce and BDS tests to the residuals of the ARIMA + ELM model confirmed its ability to capture the underlying data structure without leaving any significant autocorrelation or nonlinearity.

Overall, this research underscores the importance of integrating both linear and nonlinear techniques to enhance the precision of agricultural price forecasting models. The findings contribute valuable insights to the field of agricultural economics and market forecasting, providing stakeholders with a reliable tool for making informed decisions. Future research could explore the integration of hybrid models with other advanced machine learning algorithms or deep learning techniques to further enhance prediction accuracy and support strategic decision-making in agricultural markets.

References

  1. Alkesaiberi A, Harrou F, Sun Y. Efficient wind power prediction using machine learning methods: A comparative study. Energies. 2022;15(7):2327.
  2. Alsuwaylimi AA. Comparison of ARIMA, ANN and hybrid ARIMA-ANN models for time series forecasting. Inf. Sci. Lett. 2023;12(2):1003-1016.
  3. Anjoy P, Paul RK. Comparative performance of waveletbased neural network approaches. Neural Comput Appl. 2019;31:3443-3453.
  4. Bhardwaj SP, Paul RK, Singh DR, Singh KN. An empirical investigation of ARIMA and GARCH models in agricultural price forecasting. Econ Anal Policy. 2014;59(3):415-428.
  5. Bao W, Cao Y, Yang Y, Che H, Huang J, Wen S. Datadriven stock forecasting models based on neural networks: A review. Inf. Fusion. 2024;102616.
  6. Chen Y, Bhutta MS, Abubakar M, Xiao D, Almasoudi FM, Naeem H, et al. Evaluation of machine learning models for smart grid parameters: Performance analysis of ARIMA and Bi-LSTM. Sustainability. 2023;15(11):8555.
  7. Cheng H, Huang A. SVM-based agricultural crop price prediction model. IAENG Int. J Comput Sci. 2025;52(2):307-316.
  8. Das D, Chakrabarti S. An Extreme Learning Machine approach for forecasting the Wholesale Price Index of food products in India. Pertanika J Sci Tech. 2023;31(6).
  9. Das T, Paul RK, Bhar LM, Paul A. K. Application of machine learning techniques with GARCH model for forecasting volatility in agricultural commodity prices. J Indian Soc Agric Stat. 2020;74(3):187-194.
  10. Fernández C, Salinas L, Torres CE. A meta extreme learning machine method for forecasting financial time series. Appl Intell. 2019;49:532-554.
  11. Jadhav V, Reddy BV, Gaddi GM. Application of ARIMA model for forecasting agricultural prices. J Agric. Sci. Technol. 2017;19(5):981-992.
  12. Janiesch C, Zschech P, Heinrich K. Machine learning and deep learning. Electron Mark. 2021;31(3):685-695.
  13. Kigo SN, Omondi EO, Omolo BO. Assessing predictive performance of supervised machine learning algorithms for a diamond pricing model. Sci. Rep. 2023;13(1):17315.
  14. Kriechbaumer T, Angus A, Parsons D, Casado MR. An improved wavelet-ARIMA approach for forecasting metal prices. Res Policy. 2014;39:32-41.
  15. Nassibi N, Fasihuddin H, Hsairi L. Demand forecasting models for food industry by utilizing machine learning approaches. Int. J Adv. Comput. Sci. Appl. 2023;14(3):892-898.
  16. Özdemir O. Cue the volatility spillover in the crypto currency markets during the COVID-19 pandemic: Evidence from DCC-GARCH and wavelet analysis. Fin Innov. 2022;8(1):12.
  17. Paul RK, Garai S. Performance comparison of waveletbased machine learning techniques for forecasting agricultural commodity prices. Soft Comput. 2021;25(20):12857-12873.
  18. Paul RK, Vennila S, Yadav SK, Bhat MN, Kumar M, Chandra P, et al. Weather-based forecasting of sterility mosaic disease in pigeon pea (Cajanus Cajan) using machine learning techniques and hybrid models. Indian J Agric Sci. 2020;90(10):1952-1958.
  19. Paul RK, Vennila S, Yeasin M, Kumar S. Wavelet decomposition and machine learning technique for predicting occurrence of spiders in pigeon pea. Agronomy. 2022;12(6):1429.
  20. Paul RK, Yeasin M, Kumar P, Paul AK, Roy HS. Deep learning technique for forecasting the price of cauliflower. Curr Sci. 2023;124(9):1065-1073.
  21. Peng Y, He K, Yu Q. Stock index prediction method based on ARIMA-ELM combination model. In: 2021 4 th International Conference on Advanced Electronic Materials, Computers and Software Engineering (AEMCSE), IEEE, 2021, p. 637-642.
  22. Rathod S, Singh KN, Paul RK, Meher SK, Mishra GC, Gurung B, et al. An improved ARFIMA model using maximum overlap discrete wavelet transform (MODWT) and ANN for forecasting agricultural commodity price. J Indian Soc Agric Stat. 2017;71(2):103-11.
  23. Ray M, Rai A, Ramasubramanian V, Singh KN. ARIMA-WNN hybrid model for forecasting wheat yield time-series data. J Indian Soc Agric Stat. 2016;70(1):6370.
  24. Ray M, Singh KN, Ramasubramanian V, Paul RK, Mukherjee A, Rathod S. Integration of wavelet transform with ANN and WNN for time series forecasting: An application to Indian monsoon rainfall. Natl Acad Sci Lett. 2020;43(6):509-13.
  25. Rubio L, Alba K. Forecasting selected Colombian shares using a hybrid ARIMA-SVR model. Math. 2022;10(13):2181.
  26. Setiawan B, Abdallah M, Farkas FM, Suhendra A. GARCH models and analysis of stock market turmoil during COVID-19 outbreak. J Risk Financ Manag. 2021;14(12):576.
  27. Wang J, Lu S, Wang SH, Zhang YD. A review on extreme learning machine. Multimedia Tools Appl. 2022;81(29):41611-41660.
  28. Yadav B, Ch S, Mathur S, Adamowski J. Assessing the suitability of extreme learning machines (ELM) for groundwater level prediction. J Water Land Dev. 2017;32(1):103.
  29. Zhang GP. Time series forecasting using a hybrid ARIMA and neural network model. Neurocomputing. 2003;50:159-175.
  30. Zhu R, Zhong GY, Li JC. Forecasting price in a new hybrid neural network model with machine learning. Expert Syst Appl. 2024;249:123697.
Citations
1
FWCI
0.00
field-weighted impact
References
10
Percentile
9%
vs. same field & year

Cited by 1

From OpenAlex, OpenCitations and reference lists read by Scinovex

  • A comparative study of time series and wavelet-based models for accurate Mesta price forecasting in Andhra Pradesh

    B Ramana Murthy, Shaik Shameem · International Journal of Advanced Biochemistry Research · 2026

    This study focuses on comparing traditional time series models and wavelet decomposition-based models to identify the most effective method for forecasting Mesta wholesale prices in the Amadalavalasa market of Andhra Pradesh. Utilizing monthly price data from January 2010 to December 2024, various models including ARIMA, GARCH, Artificial Neural Networks (ANN), Wavelet-ARIMA (WARIMA), Wavelet-ANN (WANN), and Wavelet-GARCH (WGARCH) were evaluated. Model performance was assessed using accuracy metrics such as Root Mean Squared Error (RMSE), Mean Squared Error (MSE), and Mean Absolute Percentage

    ❝ 0PDFOn ScinovexFound by Scinovex
Citation Network

How this paper connects to the literature. Drag to explore, click any node to open that paper.