Application of Artificial Neural Network Model in Predicting Price of Milk in Iran

Changing economic welfare is one of the most important parameters considered by politicians in applying economic policies in agricultural sector. Modifying expenditures is a factor that influences on producers and consumers` economic welfare. Due to the significant impact it has on nutrition and food, job and income of society, milk is a product that is supported by Iranian government. Objective of the research is to predict price of farm gate milk by applying ARIMA and Artificial Neural Networks (ANN). Data from February 2006 to March 2013 were collected from Bureau of Animal Husbandry and Agriculture Support of Iran. The data used had the ability of prediction. Econometric criteria such as R , MAD, MAPE and RMSE were also used in order to compare ARIMA error prediction. The results indicate that ANN demonstrated minor error for predicting milk price in a five-month time horizon and it is more accurate than the ARIMA method. Both models predict high fluctuations in milk price as a result of high production risk existing in livestock sector of Iran.


Introduction
Prediction plays a fundamental role in suitable policies in economy.Economic forecasts shed light on path of the future and authorities may conduct more effective measures in the future.Forecasts can help reduce possibilities during arranging future strategies in operational level, moreover allocating resources to objective activities affectively (Abdy & Rezaey, 2009).
Milk production industry in Iran has appropriate capital return.But intense and unexpected fluctuations in price of product led to production with high risk (Fars Agricultural Department, 2009).
Due to properties of production in agriculture and sectors where there is a gap between decision-making for production to implementation, price prediction has always been an interesting issue for producers and consumers, since prices have a key role in production optimization, marketing, and market strategy.Therefore by considering relative stability of prices and milk price, forecasts can have a significant role in policy-making for containing price stability and finally for reducing market risk (Fahimy et al., 2011) Various models are used and exploited in order to predict economic variables, the most important of which is regression or polynomial technique, spontaneous regression, animated average, Box and Jenkins models, structural models, time series models and so on.In recent decades, modern forecast methods called 'artificial neural networks' were founded and they can discover relations between complex and non-linear variables by adapting learning process of human brain ( Fahimy et al., 2011).
There have been some studies regarding time series prediction by means of auto-regression and artificial neural networks which are as follows: Tayeby et al. (2009) predicted egg price in Iran by means of artificial neural network and ARCH method for one-month, six-month and twelve-month time horizons.The data in this study included egg prices from 1992 to 2006.The results of the research demonstrated that artificial neural network presents more accurate prediction in most of time horizons compared to ARCH.Abdy and Rezaey (2009) predicted corn and soybean price by means of fuzzy-neural network.The results we obtained from comparing the two models based on two criteria of root mean square error (RMSE) and mean absolute error (MAE) indicating that in both cases, fuzzy-neural model was able to provide more appropriate results compared to ARIMA.
In a study Fahimy-fard et al. (2011) compared the ability of prediction in fuzzy neural model (ANFIS) with neural network model (ANN) and auto regression (ARIMA) for weekly price of egg.The results indicated that compared to ARIMA model, ANN and ANFIS have higher efficiency in forecasting egg price.The same story is true for ANFIS model compared to ANN.Therefore, it is suggested to expand modern forecast methods such as neural network in order to obtain a more accurate planning.Haofei et al. (2007) reviewed short-term prediction of random price in China by applying MSOA(Note 1), BP(Note 2) and ARIMA(Note 3).They indicated that BP faces some problems such as weak and gradual convergence.Therefore, MSOA model was suggested in order to defeat weakness of BP.The researchers found that predicting MSOA is significantly more accurate than ARIMA and BP.

Process of ARIMA Model
A prediction includes deduction of probable distribution of future observation, providing previous values of one sample (like Z) are clear.In this line we need a series of key random models with the ability of describing conditions that exist in practice.Stationary processes are key series of random process.Certain stationary random processes which are not qualified for determining time series mode include autoregressive processes, animated mean and mild processes of auto-regressive animated mean (Menhaj, 1998) ARIMA model is indeed a summarized form of vector model which can forecast time series vector models with sufficient data.

ARIMA model or Box and Jenkins include four steps:
1) Recognition or test identification: if time series is put after first-time d times and copied by ARMA (p,q) model, then the main time series will be ARIMA (p,d,q).In this step, we seek to specify true values of p,d,q and we may apply correlation chart tools.If is drawn against k, then correlation chart will be time series.
Auto-correlation of the sample (SAC) with k pause includes: In this formula: is auto-correlation coefficient, Z is stationary time series in d times, b is steps of difference for time series, k is number of pauses and n is number of observations.Minor auto-correlation (SPAC) of the sample with pause k includes: In this formula: is minor auto-correlation Each stochastic process shows a certain model of SAC and SPAC and according to models` condition and pauses of SAC and SPAC which have climax points, we can recognize the time series (Moshiry and Marevat, 2006).Also we can determine number of auto-regressive lines and number of animated mean lines by Akaik information criterion (AIC) and Schwarts Bayesian criterion (SBC) which need to possess the least value (Haykin, 1999).
2) Estimation phase: after recognition we estimate the model parameters.In order to estimate, ordinary least square (OLS) is applied.
3) Recognition control: by conducing stationary test on remaining of the model ARIMA, the model is controlled from aspect of fit goodness.If the remaining is white noise difference, then the model will be approved.Otherwise, the model will be rejected and previous steps will be repeated.4) Prediction: in this phase, short-term time series are dealt with through the final model.In many cases ARIMA predictions are short-term and they are more valid than econometric traditional modeling (Cheraqi and Qolipour, 2010).

Neural networks based on ARIMA:
There are other points of view in line with time series models regarding predication where certain hypotheses are not required on variables` behavior and this is a key excellence in artificial neural network methods.The networks` structure are similar to human body.As an information processing system, brain is formed of main structural elements called Neuron.Artificial neural networks include a group of connected Neurons and each group of the Neurons is called a layer (Menhaj, 1998).A neural network is formed of three layers called input, hidden and output.Input layer receives only information and acts like an independent variable.Therefore, value of Neurons in input layer depends on dependent variables.Output layer acts like a dependent variable and value of Neurons depends on dependent variable.But despite input and output layers, hidden layer does not demonstrate any concept and is only an average result in calculating output value, but it is significant in training processes (Qadimi and Moshiry, 2002).In fact, input Neurons receive external signals which are fed by network.These signals were moderated by some weights.According to this moderation, in each output inputs are collected and afterwards they are passed from activation function.This output is the one we need (Haykin, 1999).Each input can penetrate into more than one output Neuron and the output Neuron may be input of another group of new output Neuron.In this condition, Neurons are called hidden Neuron in the middle layer.This explanation is for propagation neural network.Once a propagation neural network includes hidden Neurons, it is called multilayered perceptron neural network (Hoff, 2003).
Mathematic equation of processing Neurons is as follows: : x : inputs, y : output of k`s Neurons, ϕ(0): activation function, w : Sinapsi weights and : b bias of k`s in this equation.Sinapsi weights are applied for defining power and size of each input.The weights are moderated during training process in order to achieve an appropriate neural network structure.Bias is diagonal Neuron which has a constant input value and demonstrates a similar definition of intercept in econometric models.Sigmoid function neural network and Hyperbolik tangent function are the most important activation functions (Moshiry and Marevvat, 2006).In neural network literature, learning or training for discovering are used instead of estimating coefficients in order to find network weights (Qadimi and Moshiry, 2002).The aim of training is moderating communicative weights in line with minimizing network error.
Many training algorithms are applied for artificial neural networks.Back-propagation algorithm is the most common algorithm.The network designed should be constantly examined in order to obtain accuracy, network validity, ability of generalizing network and possibility of comparing component model.The test results are compared with real results.Neural network is approved only when it represents appropriate results for each set of tests.In this research the network applied for forecasting series is propagation neural network (multilayer perceptron neural network).
In order to examine the network, data were divided into two sections like ordinary prediction approaches and the classification totally looks like prediction quantitative approach.In order to specify number of input layers in neural network, we use auto-regressive vector time equation in ARIMA method and auto-regressive (p) and mean animated (q) were applied based on the least prediction error.Data of April, 2006 to March, 2010 were used for training and data of April, 2011 to March, 2002 were applied for testing.
In this paper, RMSE(Note 4), MAPE(Note 5), MAD(Note 6) and R2(Note 7) criteria were applied in order to compare prediction power in the two models.The data included milk diaries from March, 2002 to July, 2013.And they were collected from Iran`s animal and support database for department of agriculture.Meantime, EVIEWS and MATLAB were used for analyzing different sets of data.

Results and Discussion
Results of estimating process ARIMA are as follows: Appling prediction regression model requires stationary investigation of the variables.
With the help of data from April, 2006 to March, 2010 and by means of moderated Dickey Fuller Test, first we dealt with farm gate milk price variable series.
Findings of the stationary variables indicate that the milk price series is in level of non-stationary and can become stationary by one-time differentiation.Therefore, stationary times for this series is (d=1).
According to the results of moderated Dickey Fuller stationary test in regression process for milk price series, ARIMA was recognized and identified.After specifying stationary times, auto-explanatory line number (p) and number of mean animated lines (q) are calculated by applying the method suggested by Pesaran and Pesaran and based on Schawartz-bizzen criterion.The model with the least value of Schawartz-bizzen will be selected.Meantime, the model was controlled from aspect of fit goodness, the remaining is white noise disturbance and the model will be accepted.
Therefore, the best model of ARIMA for price of farm gate milk in form of (1,1,1) which has the least statistics of Schawartz-bizzen (13/99) is selected whose findings are in

Comparison of Artificial Neural Network and ARIMA Models
In this research multi-layered perceptron neural network was used which is an appropriate network for predicting time series.In this research also logistic function was applied including hyperbolic tangent and Sigmoid tangent in the hidden layer and linear activity function in the output layer.Back-propagation learning algorithms in the hidden and output layers were used among calculation rules.The best method for determining hidden layered Neurons is trial and error.Therefore, Neurons with two hidden layers increased to 30 Neurons and the best network was chosen with fine Neurons value.At last, by exploiting Back-propagation algorithm, each network was trained.Finally, using criterion MSE, the best network was selected for forecasting farm gate milk price for 5-month time horizon whose details are presented in table (3).Comparing two methods, we found that artificial neural network was a more reliable method which is able to predict the variables with the least error.Hence, artificial network was applied in order to predict the series.The prediction results of the variables from April to July 2014 were presented in table (5).

Conclusions
The results from cumulative mean animated auto-regression time series indicated that neural network has higher level of prediction compared to ARIMA.According to impact of milk price on price of dairy products and its market regulation condition, ranchers and producers should take future prices of this input into account.Considering price of milk in the future, agricultural authorities can reduce price fluctuations and consequently reduce the high risk present in dairy products` market and finally can increase producers and consumers` welfare.In fact, they can support ranchers and dairy product units in making the right decision by identifying and showing future price condition in this sector in different times.Since the price prediction is a key factor and it is significant to have up-to-date information, it is recommended to examine market condition in the future researches at universities and research centers and also to apply different prediction methods such as neural network method in order to reduce diary production risk in Iranian Agricultural Sector.

Table 2 .
table (1).And the results of selecting appropriate pause for farm gate milk are reviewed in table (2).Results of estimation process ARIMA (1,1,1) for farm gate milk price

Table 3 .
selecting perceptron neural network of farm gate milk price fromFebruary, 2006 to March, 2011In table (3) in addition to function type used in the hidden layer of these networks, number of optimum Neuron in input layer (ni), hidden(nh) and output one(no) in each networks are presented.Neural network which had been selected as the best network with ARIMA model was compared.The results of prediction power of two models for neural networks and ARIMA for farm gate milk price are presented in table (4).

Table 4 .
comparing prediction power in ARIMA and ANN methods for farm gate milk price

Table 5 .
values predicted in farm gate milk price (price in Rials)