FORECASTING AGRICULTURAL COMMODITY PRICE USING DIFFERENT MODELS: A CASE STUDY OF WIDELY CONSUMED GRAINS IN NIGERIA

Purpose. This study highlights the specific and accurate methods for forecasting prices of commonly consumed grains or legumes in Nigeria based on data from January 2017 to June 2020. Methodology / approach. Different models that include autoregressive integrated moving average (ARIMA), artificial neural networks (ANN), seasonal decomposition of time series by loess method (STLM), and a combination of these three models (hybrid model) were proposed to forecast the sample grain price data. This study uses price data on widely consumed grains, such as white maize, local rice, imported rice, and white beans, in Nigeria from January 2017 to June 2020. Results. Our result indicates that ARIMA is the best applicable model for white maize and imported rice because it is well fitted to stationary data, as demonstrated in the sample period. The STLM is more appropriate in forecasting white beans. As white beans are highly seasonal in Nigeria, it further explains why the STLM model fits better in forecasting prices. The production of local rice is inconsistent in Nigeria because of erratic rainfall and stiff competition from the importation of rice from other countries. Therefore, and consistent with the analysis, the hybrid model is the best model applicable to local rice because it captures varying trends exhibited in the data. Originality scientific novelty. This study suggests accurate in sub-Saharan African countries . It considers forecasting prices of commonly consumed and legumes in and incentive to guide the allocation of financial resources to the agricultural sector, which determines the structure and degree of sectoral growth.

Introduction and review of literature. Currently, price anticipating methods of agriculture sector can be segregated into two sorts i.e., qualitative and quantitative forecasting approaches. As an addition to the techniques of forecasting prices for agricultural products, the qualitative forecasting techniques generally do not dominate the usual position with small accuracy and big subjectivity. Depending on the distribution of time, quantitative forecasting techniques can be divided into ISSN 2414-584X . Hence, the time series analysis technique was substituted with the econometric technique in the 1990s. Due to the perplexity and stalemate difficulty of price forecasting agricultural products, price volatility always reveals the features of repeated brunt, unpredictability, etc. The advantage of selfadaptation, self-learning, and self-organization possessed by the intellectual anticipation technique corresponds to the features of market price volatility of agricultural products. Therefore, in recent times, the intellectual anticipation technique has been progressively applied to the forecasting agricultural price. Intelligent prediction techniques usually comprise artificial neural network, chaos theory, entropy analysis, extreme learning machines, radial basis function, and support vector regression.
The agricultural sector contributes significantly to the Gross Domestic Product . Hence, this study provides accurate forecasting techniques for specific agricultural commodities in sub-Saharan African countries. Price fluctuates all year round; therefore, understanding the trend of such fluctuations helps producers, consumers, and policy makers in better decision making. Generally, when price increases, a household will spend more of its disposable income on food compared with the income spent before the price increase (Van Wyk & Dlamini, 2018).
Recently, few studies have examined forecasting of agricultural commodity prices in Africa (Zhang et al., 2020; Tomek & Kaiser, 2014). This study addresses the gap as it considers forecasting prices of widely consumed grains and legumes in Nigeria, such as imported rice, local rice, beans, and maize. These products are essential to overcome food deficit, increase income of households, reduce expenditures, and increase revenue for manufacturing industries. Nigeria is the most populated country in Africa, thereby making it the highest consumer of grains in tropical and Sub-Saharan Africa (USAID/MARKETS 2010). Commodities consumed in high proportion in Nigeria play a significant role in the prices of such commodities in Africa. The U.S. Department of Agriculture (USDA), Production, Supply and Distribution (PSD) production dataset for the years 2012/2013 and 2016/2017 produce marketing years indicate that the production of corn in Nigeria is between 7.0 and 7.8 million metric tons (PSD 2017). Maize is among the most significant crops and staple foods consumed in Nigeria. Nigeria is the 10th largest maize producer in the world and the major producer in Africa with a yearly production of more than six million metric tons (USAID/Markets, 2010). The demand for maize grain is increasing due to its enormous usage as raw material used by poultry farms, breweries, food, and beverage industries.
Beans are one of the largest produced legumes in Africa, with Niger and Nigeria producing more than 75 % of the total beans/cowpeas ( In Nigeria, rice is a prominent staple food among the agricultural commodities consumed. Rice cultivation is common mainly in the rice farms clustered in the northern to the middle belt in Nigeria. Rice consumption has increased by 10 % per year because of shifting consumer preferences (Akande, 2003). Ebuehi & Oyewole (2007) found that many Nigerians prefer imported rice brands rather than local rice varieties, mainly because local rice is not processed to meet international standards. The fluctuating prices of agricultural commodities have a substantial effect on the population's well-being and on the outputs and inputs of agricultural production. Therefore, this study underscores the specific and accurate methods for forecasting prices of commonly consumed grains or legumes in Nigeria. Accurate forecasting of grain prices will help agricultural policy makers, producers, and consumers to make informed decisions to ensure optimal profit, risk reduction, and build resistance against food insecurity, and farmers can decide the quantity to produce and the prices to set when cultivating crops (Dorosh & Haggblade, 2003;Vågsholm et al., 2020). Badmus & Ariyo (2011) showed that forecasting helps policy makers with regard to production, price structure, and consumption of maize in Nigeria. Agricultural commodity prices can also help in predicting inflation. Tule et al. (2019) examined the predictability of agricultural commodity prices in Nigeria's inflation forecast. Their result indicated that agricultural commodity prices can individually predict food and headline inflation. Considering the use of various variables to estimate and forecast agricultural prices, appropriate models suitable for accurate forecast of individual commodities prices should be developed, because each commodity is likely to exhibit different characteristics or a trend during price determination. Hence, this study underscores forecasting of the most commonly consumed grain in Nigeria using the appropriate forecast models.
In forecasting agricultural commodity prices, studies have used various models with interesting results. Odior (2014) examined the effect of macroeconomic policy indicators on agricultural performance in Nigeria. The study employed a one-step dynamic forecast model to analyze this effect with annual time series data from 1970 to 2012. The findings showed that monetary aggregate, change in technology introduced over time, public spending on agriculture, rate of inflation, exchange rates, and nominal interest rates significantly influence the gross domestic product in Nigeria. Joshua et al. (2019) employed the Dicky-Fuller Test and simple exponential smoothing model to forecast beans prices in Adamawa state, Nigeria. The exponential smoothing model suggested an increase in beans prices. Agricultural production is risky in that it affects producers and consumers, hence the need for long-term strategies to mitigate these risks. Rashid & Jayne (2010) highlighted that farm income would increase by 30 % if effective risk management strategies are used. Appropriate statistical models should be used to understand these risks. Higgins et al. (2015) used the normalized difference vegetation index (NDVI) to identify and control for differences in productivity conditions for the prices of millet in three West African countries (Niger, Mali, and Burkina Faso). They found that NDVI information positively improves price forecast, which helps in the timely detection of food insecurity and with the planning and execution of a response. Nigeria is vulnerable to food insecurity because agriculture depends on rainfall and is a means of employment to most of its population. Zakari et al. (2012) forecasted production of two staple food grains (millet and sorghum) using the ARIMA model based on data for 1970-2010. They established that by 2030, the overall production of grains would be approximately 12678 thousand tons, with sorghum and millet production at nearly 1574.8 thousand tons and 4503 thousand tons, respectively. Such forecasting information will help policy makers to reduce the nation's vulnerability to food insecurity as regards price structure, production, and consumption.
The trend of food prices consumed locally and for export is an important budgetary tool for government agencies and food aid programs (Ackello-Ogutu, 2011; Schnepf, 2016; Sanusi, 2018; Kitenge & Morshed, 2019). Few among the existing studies analyze agricultural prices with specific techniques to forecasting commonly consumed grain prices in Africa. Chen et al. (2010) used the asset-pricing method to forecast world agricultural prices. They found that the indices of the exchange rate and equity market of Australia, Canada, and New Zealand can forecast the changes of major food and agricultural commodity prices. Conversely, Taylor et al., (2006) forecasted crop prices for soybeans, corn, and sorghum in Kansas, United States, using historical averages augmented with the current market data. They found that this method improved the accuracy of forecasts based on post-harvest data. Zhang et al., (2020) used a model selection framework to forecast grain prices. Support vector regression (SVR), artificial neural network (ANN), and extreme learning machine (ELM) were used as prediction models. Their results suggested that less grain features are a feasible methodology to improve the model selection performance, and for grain produce, varying distributions of the time series characteristics are suitable for price forecasts. Forecast models for agricultural prices perform differently for each forecast period; therefore, the forecast period is essential for selecting the right forecast model. This issue remains underexplored in the literature on the model selection framework to forecast prices of agricultural commodities. To fill the gap in literature, this study suggests specific and suitable model selection framework comprising time series features for forecasting agricultural commodity prices for each grain considered. In this study we propose an appropriate forecasting model for each grain price over time with detailed insights to the procedure used in the selection.
This study is presented as follows: section 2 presents the purpose of the article, as well as materials and methods; the results and discussions are reported in section 3; the study is concluded in section 4.
The purpose of the article. This study highlights the specific and accurate methods for forecasting prices of commonly consumed grains or legumes in Nigeria based on data from January 2017 to June 2020.
Material and methods. Data on grain prices used in this study are obtained from the National Bureau of Statistics (NBS) in Nigeria; the data is available on request and also available on the bureau website. These prices were collected from the local governments across states, and it reflects the actual household prices. The average of commodity prices is collected every month and reported by the states, and then the country average is the combined average of all states. Data from respondents were gathered by more than 700 staff located in all states of the federation. These staff members are supported by supervisors, who are also monitored by internal and external observers. To maintain the standards of data collection, the NBS audit team conducts random selected verification of the collected prices. From these data, we selected the most widely consumed grains and legumes across the country: white maize, local rice, imported rice, and white beans. All grain prices consist of 42 periods from January 2017 to June 2020. In Figure 1, white beans and white maize show a relatively downward trend toward the end of 2019, after which both increase progressively. Local and imported rice show a similar pattern of a relatively stable trend for both until the third quarter and a gradual rise.
where MAE b and MAE p are from the benchmark and proposed models, respectively. A ratio less than 1 shows that the proposed forecasting model is more efficient than the benchmark model, and if Ω tends to 1, then the two forecasting models are nearly equivalent, or else, the proposed model works poorly where, d1  is the degree of differencing; 1B  = − is the differencing operator; And (4) The best fit ARIMA model is selected according to AIC, AICc, or BIC value. 2. STLM. Seasonal and trend decomposition using loess method (STLM), developed by Cleveland et al. (1990), is a versatile and robust method for decomposing time series. Loess is a method for estimating nonlinear relationships. STLM can be robust to extreme values; consequently, these values will not affect the estimates of the trend cycle and seasonal components. In addition, STLM can handle any type of seasonality.
3. Artificial neural network. The nnetar function is used in fitting the ANNs. This function is described as feed-forward neural networks with one concealed layer and lagged inputs for forecasting univariate time series. This function fits Neural Network Autoregressive models NNAR (p, P, k). For the nonseasonal time series, the default is the optimum number of lags, which give the AIC, for a linear auto regressive (p) model (Hyndman, 2006). 4. Hybrid model. The hybrid model fits numerous individual model specifications to allow easy creation of collective forecasts. The hybrid model consists of a combination of three models: ARIMA, ANN, and STLM. Each component of the hybrid model captures its specific trend inbuilt in the model. For example, STLM is used for highly seasonal data, ARIMA is used for stationary data that is linear, ANN is used for nonlinear data.
Results and discussion. This section presents the empirical results of the models used for forecasting the price of legume and grains (white beans, white maize, local rice, and imported rice) using four approaches: the ARIMA, STLM, ANN models, and the hybrid combination of the three models.
In this study, the Anderson-Darling (AD) normality test was used to confirm if the residuals after approximation for the four models followed a normal distribution. The normality test yielded the following p-values for the following legumes and grains for the four models, Hybrid, ARIMA, STLM, and ANN, respectively: (1) white beans residuals: 0.5787, 0.3629, 0.06149, and 0.01706, (2) white maize residuals: 0.0549, 0.02835, 0.01366, and 0.0006516, (3) local rice residuals: 0.4596, 0.002722, 0.3162, and 0.09366, and (4) imported rice residuals: 0.5856, 0.01944, 0.5379, and 0.005839. The tests for normality for the residuals of the four data sets indicate that the normality assumption was not satisfied for all models. Given that the data are not normally distributed (without loss of generality), to compare the performance of the models through the four datasets, forecasting accuracy measure MAE was used over the forecasting period for each model. Smaller values of MAE indicate higher forecasting accuracy. Therefore, the ratios of the MAE of the hybrid Agricultural and Resource Economics: International Scientific E-Journal http://are-journal.com model to those of the ARIMA, STLM, and ANN models were analyzed. Table 1 lists the complete empirical results for MAEs using the actual and predicted values of ARIMA, STLM, ANN, and Hybrid models. The forecasting model is chosen based on the forecasting criterion MAE. The efficiency ratio defined in equation (1) is used for this selection.  , respectively. This result shows that the relative efficiencies of STLM model to the ANN, ARIMA, and Hybrid models equal Ω = 0.2759, 0.9115, and 0.5260, respectively. Therefore, the STLM model is more efficient compared with ARIMA and is superior to the ANN and Hybrid models for white beans data. However, given the second choice in this case, the ARIMA model can be used because it is almost as efficient as the STLM model, although it is not a perfect substitute.
The ANN model is applied for white maize with an average of 1,000 networks, which is a 3-25-1 network, with 126 weights and an estimated noise variance of 0.00008. For the ARIMA model, the result shows that the best fit model was the ARIMA (0,1,1) and an estimated noise variance of 210.   18.64, and 20.72 for ARIMA, STLM, ANN, and Hybrid models, respectively. This result shows that the relative efficiencies of the ARIMA model to the STLM, ANN, and Hybrid models equal Ω = 0.6026, 0.8777, and 0.7897, respectively. Therefore, the ARIMA model is more efficient than ANN and is superior to the STLM and Hybrid models for white maize data. However, as a second choice for this grain, the ANN model could be considered. The ANN model is applied for local rice with an average of 1,000 networks, each of which is a 2-25-1 network, with 101 weights and an estimated noise variance of 3.85. For the ARIMA model, the result shows that the best fit model was the ARIMA (0,1,0)  Therefore, the ARIMA model performs more efficiently than STLM, and is superior to the ANN and Hybrid models for imported rice data. However, as a second choice, the STLM model should be considered. Figure 2 illustrates a comparison of the forecast for the grains using the best forecasting model with the actual values. It shows that the predicted values are close to the actual values; therefore, it substantiates the valid use of the suggested models. After feeding the model with data from November 2019 to June 2020 and repeating the procedure the forecasts for the four products for the following 8 months, that is,

Figure 2. Forecasts and actual values for grains
Source: authors' work.
In our forecast, using the best model for each grain, white beans and local rice show a declining trend in prices, whereas white maize and imported rice show a relatively stable trend for the forecasts. The prediction intervals are preserved from the individual component models and use the most extreme values from each individual model, producing conservative estimates for the performance of the combination of the models. This study used different forecasting models to exploit the capabilities of the ARIMA, ANN, STLM, and the hybrid model that combines these three models in time series forecasting of grain prices in Nigeria. The forecasting performance was compared on the basis of the residuals for these models using data for some of the most widely consumed grains in the region. The study further enumerated, explained, and discussed the various forecasting approaches and the criteria used for choosing a forecasting technique to provide the best result for each grain price. These results show that there is no universally suitable technique for all grains; rather, the forecast of each grain performs better with a specific model. The study finds that ARIMA is the best applicable model for white maize and imported rice because it is well fitted to stationary data, as demonstrated in the sample period. Imported rice shows a relatively stable trend because specific quotas are allowed into the country every year, which provides some stability in its price, which also explains why the ARIMA model is the most suitable forecasting model. However, the STLM is more appropriate in forecasting white beans. As white beans are highly seasonal in Nigeria, it further explains why the STLM model fits better in forecasting prices. The production of local rice is inconsistent in Nigeria because of erratic rainfall and stiff competition from the importation of rice from other countries. Therefore, and consistent with the analysis, the hybrid model is the best model applicable to local rice because it captures varying trends exhibited in the data. For future research, we will answer questions such as; if the model decided for each grain is consistent for countries with similar characteristics for a wider range of commonly consumed grains in Africa. In addition, it will be important to test whether the importation and exportation of grains play a significant role in the forecasting methods that are chosen to forecast agricultural commodity prices. Consequently, we may apply the hybrid model for analyzing longitudinal data for African countries.

Forecasting-STLM model
Conclusion. This study uses price data on widely consumed grains, such as white maize, local rice, imported rice, and white beans, in Nigeria from January 2017 to June 2020 to forecast grain prices. Different models that include autoregressive integrated moving average, artificial neural networks, seasonal decomposition of time series by loess method, and a combination of these three models (hybrid model) is proposed to forecast the sample grain price data. This study contributes to the literature on accurate forecasting of agricultural commodity prices, and the analysis underscores the importance of providing the appropriate forecasts for policy makers, producers, and consumers for better decision making. Accurate agricultural price forecasts serve as a basic incentive to guide in the allocation of financial resources to the agricultural sector, which determines the structure and degree of sectorial growth. As prices fluctuate all year round, having information on future agricultural prices will improve planning and enhance food security.
The study finds that ARIMA is the best applicable model for white maize and imported rice because it is well fitted to stationary data, as demonstrated in the sample period. The STLM is more appropriate in forecasting white beans. As white beans are highly seasonal in Nigeria, it further explains why the STLM model fits better in forecasting prices. The production of local rice is inconsistent in Nigeria because of erratic rainfall and stiff competition from the importation of rice from other countries. Therefore, and consistent with the analysis, the hybrid model is the best model applicable to local rice because it captures varying trends exhibited in the data.
For future studies, a multivariate analysis can be performed to explore variables that explain the movement of grain prices. Also, a mixed data analysis approach could be used to see the effect of daily agricultural stock prices on future prices of grain commodities given different frequencies in available data.