Modeling and Forecasting of Food Security for Wheat in Egypt Through Year 2025 by Using time Series ARIMA Models

Wheat is one of the major crops of the agriculture sector in Egypt and, most importantly, it represents roughly as half of the ingredients for Egyptians‟ daily food. The increasing demand of wheat comes as a result of the increasing number of populations. Thus, forecasting is the main tool for government in order to manage all processes of producing, consuming, and ultimately importing wheat efficiently and effectively. This study utilizes time series models to find out the best model to forecast the wheat demand and supply in Egypt. It develops time series models based on the data of production, consumption, and imports during the period of 2016-2025. We found that the best model is ARIMA (0, 0, 1), or simply (AR1). On the basis of this selected model, we found that wheat consumption was increased by 18.54 million tons, with a minimum of 9.48 million tons and a maximum of 27.64 million tons, while the production was still 9.6 million tons and the import was about 9,5 million tons. Our prediction of this model is that Egypt will continue depending on the imports in the upcoming years if the current policies remain unchanged. We provide some recommendations to help the government overcome this predicted problem based on our analysis. We do believe our result is of value for the Egyptian government in particular and any other country that might have the same circumstances as in Egypt.


Introduction
Relevance of the research topic.Agriculture is the backbone of Egypt's economy and contributes to the economic and social well-being of the nation through its impact on gross domestic product (GDP), employment and foreign exchange earnings.Egypt is an agricultural country, where more than 40% of the population is directly or indirectly engaged in agricultural activities.
Wheat is one of the most important cereal crops of Egypt occupying an area of 3.2 million acre with an annual production of 10.3 million tonnes with an average productivity of 2.91 tonnes / acre (2017).However, the quantity of total consumption was about 18,232 million tons, with a wheat deficit of 8,889 million tons in 2017.This is due to population growth, and subsequently with the increase in the required amount of wheat and flour and the increase in prices for other food products in recent decades.The self-sufficiency rate in 2017 reached approximately 51.25%, indicating that 48.75% of local wheat consumption is covered by imports.
wheat is an important strategic component of the countries of food security.It plays a vital role in the national food security and would continue to remain so because of its wider adaptability to grow under diverse ecosystems.wheat contributes 18% of total food grain.A proper trend analysis and forecast of production of such an important crop in Egypt is having ton and the proper forecast for production and consumption would pave way for appropriate surplus and deficit management to stabilize the produced and ensure for the population need in the future.
Several techniques like simulation modelling is largely being used for forecasting of the crop production and self-sufficiency.But sometimes, forecasting is needed much before the crop harvest or even before the crop planting.The paper addresses the shortage of domestic wheat supply in Egypt that is in the inability of local production to pursue the increase in local consumption in the light of inability to expand in wheat cultivation, to suit with the increase in consumption ,it was reason of this a lot of determinants, the most important of which the limited land resources, limited water resources, increase in population, high average per capita consumption ,Thus, there is an urgent need to import wheat, which in return will greatly influence the governmental expenditures.This paper will develop a system dynamics model to forecast the wheat demand and supply of A.R.E.represent on the basis of large data and time series model with certain model assumptions are hold for better planning to improve the production to fulfill the demand in Egypt (Bader, 2017;Gujarati, 2009;Negm and Safiullin., 2018;Sassoon, 2012).

Materials and Methods
System dynamics is used to represent the Respective time series data for this study collected from (MALE andFAO,1995-2016-17), The ARIMA methodology developed by Dickey-Fuller Test Equation For forecasting purposes, various models are available and we are seeking for the best one is applied in the research for forecasting wheat production to meet the challenges, shortage of wheat in advanced (Box and Jenkins, 1976).Autoregressive Integrated Moving Average (ARIMA) (p, d, q) where, p, d and q denote orders of auto-regression is the most general class of models for forecasting a time series.integration and moving average, respectively.ARIMA technique comprises of linear time series function of past actual values and random shocks.For instance, given a time series process {Yt}, a first order autoregressive process is denoted by ARIMA (0,0,1) or simply AR (1) and is given by: Yˆπ ΦYt-1 ε and a first order moving average process is denoted by ARIMA (0,0,1) or simply MA(1) and is given by: Yˆ μ -θ1 εt-1 εt Alternatively, the ultimately derived model may be a mixture of these processes and of higher orders as well.Thus a stationary ARMA (p, d, q) process is defined by the equation: Y t = μ + 1Yt-1+2Yt-2+...+ p Yt-p -1 t-1-2 t-2+...-qt-q+t where t"s are independently and normally distributed with zero mean and constant variance 2 for t = 1, 2 , ...n.Note here that the values of p and q, in practice lie between 0 and 3 (BARUN BISWAS, L. K, et al.2014).Forecasting model Specification: Time series is one of the most important model to specify model for predict, specified on the basis of some information criteria"s which includes AIC, BIC likelihood etc. Akaike (1973) introduced AIC criteria for model specification.AIC is mathematically defined as; AIC 2logmaximum likelihood 2k Where t = p+q+1 (if model includes intercept) otherwise k = p+q.model specified well if its AIC value is minimum as other fitted models (Rani and Raza, 2012).
Identification Stage.The stationary check of time series data was performed, which revealed that the food security of wheat for Egypt.The nonstationary time series data were made stationary by first order differencing and best fit ARIMA models were developed using the data from 1995 to 2016 and Candidate ARIMA models were identified by finding the initial values for the orders of non-seasonal parameters "" and "."They were obtained by looking for significant spikes in autocorrelation and partial autocorrelation functions.At the identification stage, one or more models were tentatively.
For testing the null hypothesis "data is not stationary", we use Augmented Dickey Fuller (ADF) test.If the significant value of ADF test is less than desired level of significance which is mostly 0.05, we conclude that data is stationary.The linear relationship between two values of the similar variable is terms as autocorrelation (ACF).If we determine ACF after removing any linear dependency from the lag values, it will have called partial autocorrelation (PACF).
ACF and PACF both ranges from -1 to +1.The graphical representation of ACF and PACF is called Correlogram.In the correlogram ACF show the order of autoregressive model (p) and PACF show the order of moving average model (q).
Forecasting Accuracy Measuring Techniques: To ensure the reliability of selected forecasted value based model it is important to precisely measure its accuracy.
There is a wide range of measuring tools presented in literature: Root mean square error (RMSE), mean absolute error (MAE), mean absolute percentage error (MAPE), mean error (ME) and mean percentage error (MPE).
After model selection, a next important step is to measure the accuracy to verify the reliability of forecasted value based selected model.Various tools are available in literature which includes Root mean square error (RMSE), mean absolute error (MAE), mean absolute percentage error (MAPE), mean error (ME) and mean percentage error (MPE

∑| ̌ |
Firstly, we checked the date for stationary and examine the Autocorrelation Function (ACF) and Partial Autocorrelation Function (PACF) of the model.
Secondly, we used the estimation process of the model.Thirdly, we checked the data diagnostically and come up with forecasting.Fourth; Forecasts: Forecasts obtained at 95 % confidence interval with lower and upper limits.ARIMA model is generally applied for stationary time series data.In this study, both graphics and empirical methods were used for these purposes.Figure 1 shows the line chart of wheat production(a), consumption (b), import (c), the gap (d) and self-sufficient(e) of Egypt from the historical time series data.Figure 2 shows correlogram for yearly wheat variables [a, b,c,d,e] Referred to. Figure 1 shows time on x-axis and wheat variables from [ a, b, c, d, e] on y axis.The pattern reveals that there are many ups and downs in the wheat variables in Egypt.Long term increasing pattern of wheat production indicates that it is nonstationary (Negm and Safiullin., 2018;Shatilova et al., 2018).
After applied the Augmented Dickey Fuller (ADF) test was applied to test the data for stationarity.Correlogram of the yearly wheat production, consumption, import, gap and selfsufficient.by using the 1st difference is shown above in Figure 2. It clearly indicates that all spikes are random and very small in magnitude and the correlogram of ACF &PACF after lag one drops rapidly decrease, so, our data is stationary.When we apply ADF test on 1st difference data it shows ADF values 0.226258, 0.782476, -0.905076, -0.424190 and -1.353759 for yearly of wheat variables of Egypt respectively.So, we reject our H0 at the 5 % level of significance [1 < t tab].We conclude that our data is stationary at the 1st difference.see appendix.

Results and Discussions
After cheek using Box-Jenkins models to model validation is similar for non-linear least squares fitting.The assumptions for a stationary unvaried process are followed by the ut error term.Normally distributed or indeperdent or white noise residuals drawings should be from a fixed distribution with a constant mean and variance.When residuals satisfy overmentioned assumptions, it proves thas Box-Jenkins model is appropriate for the data.When residuals do not satisfy the assumptions, there is a need to apply another model.So we go back to the previous model identification stage for developing appropriate model.Residuals analysis shows us what model is suitable and applicable.The residual analyses is based on: After cheek using Box-Jenkins models to model validation is similar for non-linear least squares fitting.That is, the error term ut is assumed to follow the assumptions for a stationary unvaried process.The residuals should be white noise (or independent when their distributions are normal drawings from a fixed distribution with a constant mean and variance.If the Box-Jenkins model is a good model for the data, the residuals should satisfy these assumptions.If these assumptions are not satisfied, we need to fit a more appropriate model.That is, we go back to the model identification step and try to develop a better model.Hopefully the analysis of the residuals can provide some clues as to a more appropriate model.The residual analysis is based on: ()=Σ() ≈  () 1. Random residuals: The Box-Pierce Q-statistic: where r(k) is the k-th residual autocorrelation and summation is over first s autocorrelations.
2. Fit versus parsimony: the Schwartz Bayesian Criterion (SBC): SBC = ln {RSS/n} + (p+d+q) ln (n)/n, where RSS = residual sum of squares, n is sample size, and (p+d+q) the number of parameters.
We checked the data diagnostically and come up with forecasting.In addition, we also applied different graphical validation techniques i.e. histogram, normal probability plot and residual plots.The ACF indicates the values of q=1 because the correllogram of ACF after lag one drops rapidly, however, the correllogram of PACF drops promptly after lag two, hence the value of p=1.
Estimation Results Modeling results of an ARIMA AR (1) and MA1. were estimated for model [a, b,c,d,e] respectively.depend on high significant for each model and the residuals insignificant as given below.
To achieve the condition for forecasting we have made comparison among eight initail models we choose the best one model among these.We"ve used a different criterion to select the best candidate model.We emphasized the main focus on AIC, RMSE and Thiel"s inequality to select the final model.RMSE and Theil"s .The inequality shows convergence of actual and predicted values.Smaller Theil inequality is the best indicator of good predictions.So here we chose th ARIMA model.H1: t < 0 or t< 1 t ≠ 0 when [ < t tab On the basis of RMSE and THEIL"S Inequality we suggest that the best model among the parameter"s has been significant and the residuals has been insignificant.table1.thus, model coefficient summary is given in table 3.   1) is the best fits the data and having conclude that the forecasting in future with 95% of confidence interval.its parameters be will now obtained from wheat production data from table 26.
Model with high adjusted R2 indicates that the regression line perfectly fits the data, small value of Akaike info criterion is best model and Durbin-Watson around 2 indicates no autocorrelation in the model Table (2).andmodel 2 of production in [app].
In addition, we also applied different graphical validation techniques i.e. histogram, and residual plots.The ACF& PACF indicates that it is insignificant at 5 % level of significance.because the correlogram of ACF after lag one drops rapidly decrease, however, the correlogram of PACF drops promptly after lag one (see figure 3).its also means that the coefficient of ACF& PACF residual within 95% of confidence interval.
Thus, the recommended parsimonious ARIMA model for the wheat production data is ARIMA (1,0,0).through the examine the ACF& PACF coefficient of the original series of total wheat production in Egypt.we had to experiment with AR model and MA model.After several attempts it became clear that the best models are: Z t = 1.028044 z t-1 + εt………………………..(AR1) R2 = 81% T= 52% Model residuals are uncorrelated as well as independent as all three tests signify.
Three tests have been run to determine whether or not the residuals form a random sequence of numbers.A sequence of random numbers is often called white noise, since it contains equal contributions at many frequencies.The first test counts the number of times the sequence was above or below the median.Since the P-value for this test is greater than or equal to 0.05, we cannot reject the hypothesis that the residuals are random at the 95.0% or higher confidence level.The second test counts the number of times the sequence rose or fell.The number of such runs compared to an expected value.if the sequence were random.Since the P-value for this test is greater than or equal to 0.05, we cannot reject the hypothesis that the series is random at the 95.0% or higher confidence level.The third test is based on the sum of squares of the first 24 autocorrelation coefficients.Since the P-value for this test is greater than or equal to 0.05, we cannot reject the hypothesis that the series is random at the 95.0% or higher confidence level.The normality is also tested by normal probability plot and periodogram as shown in figure (4).figure indicated that the residuals of ARIMA (1,1,0) are normally distributed.its means that the coefficient of ACF& PACF residual plots.hasn"t have Autocorrelation.
Thus, the recommended parsimonious ARIMA model for the wheat production data is ARIMA ((1,1,0) = ARI (1,1).through the examine the ACF& PACF coefficient of the original series of total wheat consumption in Egypt table 2 .so, it became clear that the best models are: Estimation model of imports imports are the important variables of wheat economy in Egypt.The growth rates tell us the rate at which these parameters grew in the past.therefore, it was necessary to study wheat imports and forecast them in the future.
Using time series data, ARIMA model was applied in four steps for the purpose of forecasting as mentioned above.
Because most of the economic time series vary in a systematic way, the first step in identification was to choose and to check the data were stationary or not.The time series data about imports of wheat were analyzed and autocorrelation function & partial auto-correlation function were estimated.so, we applied the different graphical validation techniques i.e. histogram, normal probability plot and residual plots.The ACF indicates the values of q=1 because the correllogram of ACF after lag one drops rapidly decrease however, the correllogram of PACF drops promptly after lag one.The normality is also tested by normal probability plot and periodogram as shown in figure (5).figure indicated that the residuals of AR1 are normally distributed.its means that the coefficient of ACF& PACF residual plots.hasn"t have Autocorrelation.Thus, the recommended parsimonious ARIMA model for the wheat data is ARIMA (1,0,0). ( ) ( ) R2 = 79% Tsta = 33%, DW= 1,93 its meaning the ACF&PAC= 0 The results of this test show that the total wheat data for size of gap are distributed according to the natural distribution of the original data as shown in figure (6) of the original data.figure indicated that the residuals of  

1,1 ARMA
or (1,0,1) are normally distributed.its means that the coefficient of ACF& PACF residual plots were insignificant.Finally, can see the Forecasts obtained at 95 % confidence interval with lower and upper limits.The results of this test show that the total wheat data for self-sufficient are distributed according to the natural distribution.figure (7) indicated that the residuals of AR1(1,1) (1,1,0) are normally distributed.its means that the coefficient of ACF& PACF residual plots were insignificant.with the random at the 95.0% confidence level.
Thus, the forecasts obtained at 95 % confidence interval with lower and upper limits based on a criterion of the smaller values of the forecasting errors and value of Akaike info criterion.so, it became clear that the best models are: Zt = -0.540370z t-1 + εt ………………………AR(1).R2= 30% F= 7,466 DW= 2,01.The diagnostic analyses using the ACF of residuals, PACF residuals, and the normal probability plot of the residuals as shown in Figures)) reveal that the residuals of the model have zero mean and constant variance.The ACF of the residuals depicts that the autocorrelation of the residuals are all zero, that is to say they are uncorrelated, Which means that the auto-correlation between random error limits of each variable (a, b, c, d, e) are not significant and therefore the model is appropriate.Hence, it can be concluded that there is a constant variance among residuals of the selected model and the true mean of the residuals is approximately equal to zero.Thus, the selected model satisfies all the model assumptions.Since the ARIMA with lag12 satisfies all the necessary assumptions, it can be inferred that the model provides an adequate representation of the data.
Forecasting Stage; Forecasting is the process of predicting some unknown quantities, Prediction in ARIMA models depends on previous estimation methods, assuming that (n) refers to the current time period in which predictions are calculated, and we want to predict the viewing value that will occur after h of time periods, where h forecast horizon Zn (h) indicates the predictive value we obtain In the time period n for viewing Zn + h, which will occur after h of time, thus obtaining the prediction values over the time period, the upper limit of the prediction period, and the minimum prediction period.
Forecasting plays an important role in decision making process.It is a planning tool which helps decision makers to foresee the future uncertainty based on the behavior of past and current observations.Forecasting as describe by (Box and Jenkins, 1976), provide basis for economic and business planning, inventory and production control and control and optimization of industrial processes.
Forecasting using different ARIMA method; This section presents the projections of future production, consumption, quantity of import, wheat gap, and self-sufficient of wheat in Egypt, building on existing analysis.The projections are made using the Auto-Regressive Integrated Moving Average (ARIMA) for the years in the future are mentioned above in table 2. the forecasted values of nine years for wheat, with 95% of confidence interval are reported in table 4. Diagnostic checking on residual terms is made applying the of the values of three accuracy measures.(R2, AIC, MAPE, TIC).To overcome the challenges already mentioned before and reach the best possible selfsufficiency ratio of wheat needs, analysis and policies are carried out for the next 9 years until 2025 to forecast and project the future demand and supply.
The ARIMA (1, 0, 0) model projects of future wheat production will increase from 10,511 million tons in 2017 to 13.114 million tons in 2025, with an increase ratio of about 36.94 % till 2030 as compare to 2016 With 95% confidence interval, the upper limit of production would increase from 24 million tons in 2025.If the policies are implemented that lead to the best possible efficiency in production as follow in figure (8).The best fitted ARIMA model applied for wheat consumption is (1,1,0).The ARIMA model projects that consumption will increase from 19,587 in 2016 to 22,734 in 2025, with an increase ratio of about 16,066 % more than its value in 2016 (Table ).With 95% confidence interval, the upper limit of consumption would increase from 12 million tons in 2016 to 27 million tons in 2025.figure 9.This increase may be due to an increase in population of Egypt and per capita consumption.The best fitted ARIMA model applied for wheat gap is (1,0,1).Forecasting results indicate that the forecast values of wheat gap is tend to increase over the next years.With 95% confidence interval, will increase from 8,717 in 2016 to 9,620 in 2025, with an increase ratio of about 10.359 % more than its value in 2016 (Table ).Forecasting of wheat import and self-sufficient (2017-18-2025).This can be resulted from the overpopulation or and change in the consumption patterns of Egyptian people.These forecasts would be helpful for decision makers to foresee the future situation of wheat production, import, consumption and select appropriate policy.Egypt will import around 9,731 million tons of wheat over the coming year (2025) to fill the wheat gap between consumption and production.figure () also, the model predicted that the self-sufficient of wheat would increase to 57 % in 2025, the value of upper limit would increase from 52,68 % in 2016 to 57,683 % in 2025.As presented in figure (11,12).If the country adopts new policies that promote selfsufficiency Increase to upper limit of 80%.It varies greatly from a one year to another according to the population needs and the quantity of domestic production.Hence, there was a need to manage the wheat consumption and imports, which is modeled in this study to prevent the misuse and management of wheat and to avoid the increase in prices and costs due to the yearly amount of imports from foreign countries.The findings have shown that between 2017 and 2025, Egyptian wheat production at an annual increase.Growth in production is attributed to changes in harvested area land.To more increase productivity growth, farmers should be provided with new technology, access to modern inputs, and adequate logistical support.These forecasts would be helpful for decision makers to foresee the future situation of wheat production, import, consumption in order to determine further poilitical steps (Sarika and Chattopadhyay, 2011).
[a], consumption[b], import[c], gap[d] and selfsufficient % [e].during the time period 1995to 2016.X= years, Y= quantity by million ton.Estimation Stage for each model [ a,b,c,d,e] 1 -Estimation of production model; Having investigation, the main feature of wheat production data for 1995 -2016 in an attempt the lay the foundation for choice of the appropriate method a model.it has been shown the an AR(

Table 2
(Box and Pierce, 1970) parameters of ARIMA model (1,0,0) and its goodness of fit tests.through the row number one reported the test statistics of adjusted(Box and Pierce, 1970)for wheat production.By means of AR1 the forecasted values of next 8 years for wheat production, with 95% of confidence interval Figure-1.Correlogram graph Residuals ACF& PACF of Wheat Production of ARIMA (1, 0, 0) Model.We get the reliable wheat consumption future value if the selected model is good.Selected model is good one, if it fulfills the assumptions i.e.Normality, Autocorrelation and Heteroscedasticity of the selected model residuals.
Modeling results of an ARIMA process.We used the annual time series data of wheat gap from 1995 to 2016 for forecasting purpose.All the data is extracted from (MALE).The forecasting of ARIMA model involved different steps such as identification of the model or specification of the model.forthe purpose it has been applied all steps of forecasting and shown by examine auto-correlation function & partial autocorrelation function.themodel that give the best fit for the series based on a criterion of the smaller values of the forecasting errors and value of Durbin-Watson stat.We had to experiment with the self-regression model AR and the MA model.
aa HH   Estimation of Wheat Self-sufficient Model Testing the model of wheat self-sufficient rate assumptions through Normality, auto-correlation function & partial auto-correlation function.ithas been get the reliable of self-sufficient rate in wheat future value.
Forecasted Values for Wheat Import in Egypt, with 95% Confidence Interval