Artificial Intelligence in Food Quality ImprovementView this Special Issue
Research Article | Open Access
Anil Kumar Mahto, M. Afshar Alam, Ranjit Biswas, Jawed Ahmed, Shah Imran Alam, "Short-Term Forecasting of Agriculture Commodities in Context of Indian Market for Sustainable Agriculture by Using the Artificial Neural Network", Journal of Food Quality, vol. 2021, Article ID 9939906, 13 pages, 2021. https://doi.org/10.1155/2021/9939906
Short-Term Forecasting of Agriculture Commodities in Context of Indian Market for Sustainable Agriculture by Using the Artificial Neural Network
Prediction of well-grounded market information, particularly short-term forecast of prices of agricultural commodities, is the essential requirement for the sustainable development of the farming community. Such predictions are mostly performed with the help of time series models. In this study, the soft computing method is used for short-term forecasting of agriculture commodity price based on time series data using the artificial neural network (ANN). The time series data for sunflower seed and soybean seed are considered as the agriculture commodities. The soybean seed time series data were collected for the period of five years (Jan 2014–Dec 2018), for Akola district market, Maharashtra, India. The sunflower time series data were collected for the period of six years (Jan 2011–Dec 2016), for Kadari district market, Andhra Pradesh, India. The dataset is available at the Indian government website taken from the website www.data.gov.in. For forecasting, the ANN model is used on the abovementioned datasets. The performance of the model is compared with the result of the traditional ARIMA model. The mean absolute percentage error (MAPE) and root mean square percentage error (RMSPE) are considered as the performance parameters for the forecasting model. It is observed that the ANN is a better forecasting model than the ARIMA model by considering the two forecasting performance parameters MAPE and RMSPE.
In India, the 2/3rd parts of total population directly or indirectly depend on the agriculture [1, 2]. As per the survey conducted by “Agriculture Census of India” in 2011, approximately 62% of Indian population living in rural area is dependent upon agriculture directly or indirectly. To this sector of population, agriculture is the main source of income. India is second ranked in terms of production of agriculture commodity. Agriculture sector contributes almost 18% to the Indian GDP . Agriculture commodities are the important source from the earning point of view. Hence, the influence of commodity price  is crucial in Indian economy. The agriculture commodity price forecast will play the important role for the farmers, the policymakers, and various administrative offices. For example, if a farmer knows in advance the price of crop in near future (short term), then he can decide about the farming area of that particular crop to be undertaken. Other than farmers, government agencies also need to know the probable price of commodity in advance for implementing the government schemes (subsidy schemes and import/export activity) smoothly.
Agriculture commodity forecasting is very important for sustainability of future generation. With ever increasing demand of agricultural products and reduction in agricultural land, this forecasting methodology is very important for sustainability of farmers. Indian economy is majorly an agriculture-based economy. This forecasting methodology can help the farmers and other stakeholders to make it sustain for a larger duration. The advantage of this forecasting methodology includes healthy and economical food products to the consumers leading to improved health parameters. This can lead to sustainability of the agricultural land and products.
Forecasting of agricultural commodity is very essential for our day-to-day life. The agricultural price fluctuations are rising nowadays, hence, resulting in mismanagement of people’s food expenditure. Agriculturalists need to resolve this problem for the better future of agricultural commodity.
Fluctuating and rising agricultural prices are one of the major factors resulting in global fight against poverty. Many models are used for the forecasting of which statistical method is used the most. But still no proper model is made to resolve the problem efficiently.
The forecasting of agriculture commodity price is mainly divided into two parts: structural and nonstructural. The structural methods  mainly consider the supply demand ratio. Computationally, it is very difficult to estimate the consumers’ needs and the production of that particular crop for developing countries. The nonstructural methods  may be categorized as statistical technique [7, 8] and machine learning technique. For nonstructural methods, historical data are collected as time series data. The time series data can be of linear or nonlinear in nature. There are various methods  for forecasting based on time series data. The ANN is a better alternative than the statistical model for nonlinear time series data [10, 11].
Some research studies have been performed in forecasting of agriculture commodities price in developing countries such as India. According to [12, 13], there are some special features of the ANN such as nonlinearity, adaptability, and mapping procedures providing strong support for using the ANN as a good forecasting model.
In , the ARIMA model and time delay neural network (TDNN) are for time series forecasting of agriculture commodity price. They concluded that the neural network model performed better due to nonlinear nature of time series data. Finally, they presented a hybrid model for forecasting. Surprisingly, the hybrid model was less efficient than the ANN for soybean data and more efficient for mustard.
According to the work reported in , the neural network is presented which is a very good alternative for “short term” forecasting, while the Box–Jenkins method performs better for very short-term forecasting. They also discussed that the neural network without a hidden layer can work similar to the Box–Jenkins method.
Work presented in  used the support vector machine for forecasting of financial time series data to perform better in terms of efficiency in comparison with the back propagation neural network.
In , the authors presented the ANN approach for multivariate time series data. They used the dataset of flour price of three cities, and based on training and testing results, they concluded that the ANN model can well be used for forecasting.
In  too, the ANN model is used for electrical load forecasting. They used the characteristics of the ANN to learn from the relationship among the past data, current, and future temperature. Based on the testing data, the result was very satisfactory.
In , the Jordan neural network is used in forecasting the inflation based on time series data. They used macroeconomic variables such as financial variable, lagged inflation, and labor market variable. In the work , the ANN is used for sales forecasting of the apparel retail chain stores. The MAPE for the model they observed was 8.79%. Some of the applications of the ANN model for forecasting based on time series data are as follows:(1)Electricity load forecasting [21, 22](2)Financial forecasting [10, 23](3)Monthly average rainfall prediction 
This study is summarized in five sections. The first and current section contains the brief introduction of problem statement and various solutions given by the scholars. The second section elaborates the computational models ARIMA and ANN. The third section explains the implementation and result analysis for the sake of efficiency measurement of computational models discussed in second section. The fourth section explains the conclusion of work presented in this study.
2. Materials and Methods
Sunflower time series data and soybean time series data are taken in this research work. Statistical description of the data is given in Table 1. Description of soybean time series datais as follows:(1)Taken from “data.gov.in” an Indian government website(2)For the period of five years (January 2014–December 2018)(3)Data related to the Akola district market, Maharashtra, India
Description of sunflower time series data is as follows:(1)Taken from “data.gov.in” an Indian government website.(2)For the period of five years (January 2011–December 2016).(3)Data related to the Kadari district market, Andhra Pradesh, India.
2.1. Forecasting Techniques
Forecasting is defined as the prediction made on the basis of some scientific calculation based on historical data and demand-supply data. Classification of forecasting techniques  is shown in Figure 1. Forecasting technique is mainly divided into two types: “Quantitative technique” and “Qualitative Technique.” In the qualitative method, we use the facts that cannot be measured in terms of the numeric value. It is also known as judgmental forecasting  where the prediction is made on the basis of survey, events, and many more noncomputational parameters. The quantitative technique  works on numerical data or computational data. It is also known as statistical technique or time series technique. The time series forecasting can be divided into two parts: the (a) classical Box–Jenkins Models [15, 28, 29] and (b) machine learning models [30, 31]. The classical models work well on linear data, while the machine learning models work well on a wide range of data. The ARIMA model and ANN model are further discussed later in this section.
Selection of forecasting technique depends upon the various parameters. Some of them are level of accuracy required, purpose of forecasting, type of data available, tenure of the forecasting, and many more. Qualitative models for agriculture commodity forecasting are very expensive and not suitable for developing countries. As India is a developing country, time series forecasting models are suitable to forecast the agriculture commodity price. The agriculture time series data are nonlinear in nature; hence, naturally, the “Artificial Neural Network Model” is a best suitable model [32–35] for forecasting of agriculture commodity price.
2.2. Forecasting Using ARIMA
ARIMA stands for autoregressive (AR) integrated (I) moving average (MA). It works on the principle of Box–Jenkins [5, 29, 36, 37]. ARIMA  is associated with three important parameters, namely, p, d, and q as shown in Figure 2.
The working model of ARIMA is shown in Figure 3. Visualization of time series data is fundamental and most basic for ARIMA. After visualization, we can do the preprocessing of the data such as removing the outliers and dealing with missing data. By visualization, we can also conclude whether the data are stationary or not. If the series is nonstationary, then first of all, we should make time series stationary. After the stationary time series, we should find the optimal parameters for the ARIMA model with the help of ACF plot and PACF plot .
2.3. Forecasting Using the Artificial Neural Network
The feed forward neural network with a single hidden layer is used as shown in Figure 4. Back propagation concept is used for learning purpose. Let “m” be the input size (neurons at the input layer) of the neural network and “n” is the number of nodes at the hidden layer. The input is scaled into the interval [0, 1]. The activation function rectified linear unit (ReLU)  is used for finding the activation value for the input layer neuron to hidden layer neuron. Sigmoid is used for calculating the activation for the intermediate layer to output layer. The ReLU function, mathematically, is defined as
The final output of the network will be given by the following equation:where f1 and f2 are the activation functions at the hidden layer and output layer, respectively.
2.4. Learning Method
The training session of the network categories consists of two parts. In the first part of the training, the network will produce the output based on the selected input window. In second part, the error is calculated based on the actual value and the predicted value. Now, this error is propagated back via the output layer for updating the weight of the neurons in the hidden layer for next round as shown in Figure 5.
For training purpose, the error is calculated by comparing the actual value yt with the predicted value. The error is back propagated to the neural network for updating the weight of connection between the hidden layer and output layer.
The output of a neuron is calculated by the following equation:where is the output of neuron i in the Lth layer, (Bias)i is the bias in Lth layer, is the weight from ith neuron of the layer to jth neuron of layer L, and is the output of ith neuron in layer L.
The updated weight at time T will be given by the following equation:where η is the learning rate, α is the momentum, and δ  can be calculated with the help of gradient of the output function of neuron.
3. Results and Discussion
3.1. Results by Using ARIMA
3.1.1. Analyzing the Time Series Data
The implementation part is performed in R. Figures 6 and 7 show the plot of monthly average price of soybean for the period of 2014–2018 and monthly average price of sunflower seed for the period of 2011–2016, respectively.
By seeing the boxplot of soybean time series data in Figure 8, it seems that the price is with higher mean and variance in the months of February, March, and April. Similarly, in the boxplot of sunflower time series data, the price is with higher mean and variance in the months of March and April as shown in Figure 9.
3.1.2. Components of Time Series Data
3.1.3. Finding Parameters of the ARIMA Model
Stationarity of the time series data is checked with the help of the “Augmented Dickey–Fuller Test” as shown in Figure 12. The ADF test for the soybean time series data is as follows: Data: Soyabean “Dickey–Fuller” = −2.2649, “Lag order” = 3, “ value = 0.4683”
As value >0.05, hence, the series is not stationary. To get the stationary data, difference operation is applied on the data, and again, the ADF test was performed. Now, the result of ADF test is as follows: Data: diffSoyabean Dickey–Fuller = −3.4255, Lag order = 3, value = 0.04386 Alternative hypothesis: stationary
Similarly, the result of ADF test on sunflower time series data is as follows: Data: diffSunflower Dickey–Fuller = −3.829, Lag order = 3, value = 0.02325
3.1.4. Forecasting the Price
The “auto.arima( )” function is used to automatically fit the model based on the input time series data and to find the optimal parameters for the ARIMA model. ARIMA (0, 1, 0) is chosen as an optimal model for forecasting for both sunflower time series data and soybean time series data as shown in Figures 13 and 14. Figures 15 and 16 show the plot of linear models for the soybean time series data and sunflower time series data, respectively.
3.2. Results by Using the ANN
Implementation of the ANN is performed in Python. Two time series data, namely, soybean price and sunflower price are considered as the experimental dataset. The soybean time series data are collected for the period of sixty months (Jan 2014–Dec 2018), for Akola district market, Maharashtra, India . The sunflower time series data are collected for the period of sixty months (Jan 2011–Dec 2016), for Kadari district market, Andhra Pradesh, India.
3.2.1. Data Preprocessing
In data preprocessing, we mainly focus on to analyze the data, remove the noise, deal with the missing values, and transform the input value to the desired scale for the model to be implemented. The first step for data preprocessing is to plot the series. Figure 17 shows the plot of monthly average price of soybean for the period January 2014–December 2018. Similarly, Figure 18 shows the time series data for sunflower.
3.2.2. Training Dataset and Test Dataset
We used the supervised learning concept. The former 80 percent of the preprocessed data is used to train the model and last 20 percent of the data is used to test the model as per the standard accepted by the various scholars . Figure 19 shows the division of the soybean dataset into train data and test data. Similarly, Figure 20 shows the division of the sunflower dataset into train and test data.
3.2.3. Forecasting the Price
For actual forecasting, the trained model is applied on the test data. Figures 21 and 22 represent the comparison of actual price and forecasted price for the agriculture commodities soybean and sunflower, respectively. The forecasted results of the ANN model are given in Tables 2 and 3 for the commodities soybean and sunflower, respectively.
3.3. Evaluating Forecasting Accuracy
We have used two parameters “Mean Absolute Percentage Error (MAPE)” and “Root Mean Square Percentage error (RMSPE)” for the forecasting accuracy.
MAPE [43, 44] is one of the important parameters to measure the quality of the forecasting system. It is defined in the following equation:where At is the actual price at time t, Ft is the forecasted price at time t, and n is the number of the forecasted value.The MAPE by using the ANN for the forecasted sunflower time series data is 2.4 and for soybean time series data is 7.7% as given in Table 4.
RMSPE can be calculated by following the given steps: Step 1: Calculate the percentage residuals by using the following formula: where At is the “actual price”, and Ft is the “forecasted price.” Step 2: Calculate the residuals square Step 3: Calculate the mean of residuals squares by adding the residuals squares and divide it by n Step 4: Calculate the square root of mean obtained in Step 3
4. Conclusion and Future Work
Currently, India is ranked second in the world for production of agricultural commodities and contributes almost 18% in the Indian GDP. Although, the market prices of these commodities fluctuates geographically. To give a better understanding of these fluctuations to stakeholders, in this study, we have presented a short-term price forecasting model which will eventually lead to more sustainability to different stakeholders. For this, we have compared the ANN and ARIMA model for forecasting the prices. We considered sunflower time series data and soybean time series data collected from Indian government portal for training and testing purpose of the proposed forecasting model. The parameters MAPE and RMSPE are used for the accuracy measurement of the presented model. For soybean and sunflower time series data for prices, the mean absolute percentage error (MAPE) by using the ANN is 2.4% and 7.7%, respectively. Whereas by using ARIMA, MAPE for soybean and sunflower time series data is 19.76% and 15.2%, respectively. Similarly, the root mean square percentage error (RMSPE) by using the ANN for soybean and sunflower time series data is 3.15% and 8.92%, respectively, whereas, by using ARIMA for the same time series data, RMSPE is 19.84% and 15.9%, respectively. These results concluded that the ANN is a better model for forecasting of agriculture commodity price than the ARIMA model. As per the literature review, the ANN model is suitable for nonlinear time series data and the ARIMA model is suitable for linear time series data. Hence, future work will be focused on developing the hybrid model for forecasting of agriculture commodity price to overcome the limitation of the ANN model.
The data used to support the findings of this study are taken from the website “http://www.data.gov.in” managed by Government of India.
Conflicts of Interest
The authors declare that they have no conflicts of interest.
- A. Das, M. Senapati, and J. John, “Impact of agricultural credit on agriculture production: an empirical analysis in India,” Reserve Bank of India Occasional Papers, vol. 30, no. 2, pp. 75–107, 2009.
- J. Ahmad, D. Alam, and M. S. Haseen, “Impact of climate change on agriculture and food security in India,” International Journal of Agriculture, Environment and Biotechnology, vol. 4, no. 2, pp. 129–137, 2011.
- K. M. Sabu and T. K. M. Kumar, “Predictive analytics in agriculture: forecasting prices of arecanuts in Kerala,” Procedia Computer Science, vol. 171, pp. 699–708, 2020.
- D. Hellerstein and M. Scott, The Influence of Rising Commodity Prices on the Conservation Reserve Program, Economic Research Service, Washington, DC, USA, 2011.
- A. C. Harvey and P. H. J. Todd, “Forecasting economic time series with structural and Box-Jenkins models: a case study,” Journal of Business & Economic Statistics, vol. 1, no. 4, pp. 299–307, 1983.
- F. X. Diebold, “The past, present, and future of macroeconomic forecasting,” Journal of Economic Perspectives, vol. 12, no. 2, pp. 175–192, 1998.
- J. E. Hanke, A. G. Reitsch, and D. W. Wichern, Business Forecasting, vol. 9, Prentice-Hall, Hoboken, NJ, USA, 2001.
- R. Gupta, A. Kabundi, and S. M. Miller, “Forecasting the US real house price index: structural and non-structural models with and without fundamentals,” Economic Modelling, vol. 28, no. 4, pp. 2013–2021, 2011.
- C. Deb, F. Zhang, J. Yang, S. E. Lee, and K. W. Shah, “A review on time series forecasting techniques for building energy consumption,” Renewable and Sustainable Energy Reviews, vol. 74, pp. 902–924, 2017.
- A. Tealab, H. Hefny, and A. Badr, “Forecasting of nonlinear time series using ANN,” Future Computing and Informatics Journal, vol. 2, no. 1, pp. 39–47, 2017.
- J. H. Stock and M. W. Watson, A Comparison of Linear and Nonlinear Univariate Models for Forecasting Macroeconomic Time Series, National Bureau of Economic Research, Cambridge, MA, USA, 1998.
- G. Zhang, B. Eddy Patuwo, and M. Y. Hu, “Forecasting with artificial neural networks: the state of the art,” International Journal of Forecasting, vol. 14, no. 1, pp. 35–62, 1998.
- B. Sharma, S. Kumar, P. Tiwari et al., “ANN based short-term traffic flow forecasting in undivided two lane highway,” Journal of Big Data, vol. 5, no. 1, pp. 1–16, 2018.
- G. K. Jha and K. Sinha, “Agricultural price forecasting using neural network model: an innovative information delivery system,” Agricultural Economics Research Review, vol. 26, no. 2, pp. 229–239, 2013.
- Z. Tang, C. De Almeida, and P. A. Fishwick, “Time series forecasting using neural networks vs. Box-Jenkins methodology,” Simulation, vol. 57, no. 5, pp. 303–310, 1991.
- K.-J. Kim, “Financial time series forecasting using support vector machines,” Neurocomputing, vol. 55, no. 1-2, pp. 307–319, 2003.
- K. Chakraborty, K. Mehrotra, C. K. Mohan, and S. Ranka, “Forecasting the behavior of multivariate time series using neural networks,” Neural Networks, vol. 5, no. 6, pp. 961–970, 1992.
- D. C. Park, M. A. El-Sharkawi, R. J. Marks, L. E. Atlas, and M. J. Damborg, “Electric load forecasting using an artificial neural network,” IEEE Transactions on Power Systems, vol. 6, no. 2, pp. 442–449, 1991.
- T. Šestanović, “Jordan neural network for inflation forecasting,” Croatian Operational Research Review, vol. 10, no. 1, pp. 23–33, 2019.
- N. Caglayan, S. I. Satoglu, and E. Nisa Kapukaya, “Sales forecasting by artificial neural networks for the apparel retail chain stores,” Intelligent and Fuzzy Techniques in Big Data Analytics and Decision Making, Springer, Cham, Switzerland, 2019.
- S. Singh, S. Hussain, and M. Abid Bazaz, “Short term load forecasting using artificial neural network,” in Proceedings of the 2017 Fourth International Conference on Image Information Processing (ICIIP), Shimla, India, December 2017.
- L. Wu, C. Kong, X. Hao, and W. Chen, “A short-term load forecasting method based on GRU-CNN hybrid neural network model,” Mathematical Problems in Engineering, vol. 2020, Article ID 1428104, 10 pages, 2020.
- E. Dobrescu, D. I. Nastac, and E. Pelinescu, “Short-term financial forecasting using ANN adaptive predictors in cascade,” International Journal of Process Management and Benchmarking, vol. 4, no. 4, pp. 376–405, 2014.
- M. P. Darji, V. K. Dabhi, and H. B. Prajapati, “Rainfall forecasting using neural network: a survey,” in Proceedings of the 2015 International Conference on Advances in Computer Engineering and Applications, Ghaziabad, India, March 2015.
- G. Mahalakshmi, S. Sridevi, and S. Rajaram, “A survey on forecasting of time series data,” in Proceedings of the 2016 International Conference on Computing Technologies and Intelligent Data Engineering (ICCTIDE’16), Kovilpatti, India, January 2016.
- N. R. Sanders and K. B. Manrodt, “The efficacy of using judgmental versus quantitative forecasting methods in practice,” Omega, vol. 31, no. 6, pp. 511–522, 2003.
- W. W. S. Wei, “Time series analysis,” The Oxford Handbook of Quantitative Methods in Psychology, Volume 2, Oxford University Press, Oxford, UK, 2006.
- A. Pankratz, Forecasting with Univariate Box-Jenkins Models: Concepts and Cases, vol. 224, John Wiley & Sons, Hoboken, NY, USA, 2009.
- S. Makridakis and M. Hibon, “ARMA models and the box-jenkins methodology,” Journal of Forecasting, vol. 16, no. 3, pp. 147–163, 1997.
- B. Krollner, B. J. Vanstone, and G. R. Finnie, “Financial time series forecasting with machine learning techniques: a survey,” in Proceedings of the 2010, 18th European Symposium on Artificial Neural Networks, Bruges, Belgium, April 2010.
- S. Makridakis, E. Spiliotis, and V. Assimakopoulos, “Statistical and machine learning forecasting methods: concerns and ways forward,” PLoS One, vol. 13, no. 3, p. e0194889, 2018.
- G. P. Zhang, B. E. Patuwo, and M. Y. Hu, “A simulation study of artificial neural networks for nonlinear time-series forecasting,” Computers & Operations Research, vol. 28, no. 4, pp. 381–396, 2001.
- A. Maravall, “An application of nonlinear time series forecasting,” Journal of Business & Economic Statistics, vol. 1, no. 1, pp. 66–74, 1983.
- Y. Kajitani, K. W. Hipel, and A. I. Mcleod, “Forecasting nonlinear time series with feed-forward neural networks: a case study of Canadian lynx data,” Journal of Forecasting, vol. 24, no. 2, pp. 105–117, 2005.
- H. Do, K. U. Nam, and A. Mano, “Downscaling global weather forecast outputs using ANN for flood prediction,” Journal of Applied Mathematics, vol. 2011, Article ID 246286, 14 pages, 2011.
- T. H. Naylor, T. G. Seaks, and D. W. Wichern, “Box-Jenkins methods: an alternative to econometric models,” International Statistical Review/Revue Internationale de Statistique, vol. 40, no. 2, pp. 123–137, 1972.
- Y. Lu and S. M. AbouRizk, “Automated box-jenkins forecasting modelling,” Automation in Construction, vol. 18, no. 5, pp. 547–558, 2009.
- A. KumarMahto, R. Biswas, and M. Afshar Alam, “Short term forecasting of agriculture commodity price by using ARIMA: based on Indian market,” Advances in Computing and Data Sciences, Springer, Singapore, 2019.
- D. A. Dickey and W. A. Fuller, “Distribution of the estimators for autoregressive time series with a unit root,” Journal of the American Statistical Association, vol. 74, no. 366, pp. 427–431, 1979.
- T. Kolarik and G. Rudorfer, “Time series forecasting using neural networks,” ACM SIGAPL APL Quote Quad, vol. 25, no. 1, pp. 86–94, 1994.
- https://data.gov.in/resources/variety-wise-daily-market-prices-data-soyabean-2018 (accessed on 8th July 8, 2019).
- C.-I. Cira, R. Alcarria, M.-Á. Manso-Callejo, and F. Serradilla, “A deep learning-based solution for large-scale extraction of the secondary road network from high-resolution aerial orthoimagery,” Applied Sciences, vol. 10, no. 20, p. 7272, 2020.
- J. S. Armstrong and F. Collopy, “Error measures for generalizing about forecasting methods: empirical comparisons,” International Journal of Forecasting, vol. 8, no. 1, pp. 69–80, 1992.
- S. Kim and H. Kim, “A new metric of absolute percentage error for intermittent demand forecasts,” International Journal of Forecasting, vol. 32, no. 3, pp. 669–679, 2016.
Copyright © 2021 Anil Kumar Mahto et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.