Introduction

The contribution of tomatoes is 20% in per day requirement of vitamin A on the basis of 2000 calorie diet. The share of tomato is 26% in daily requirements of vitamin C .In Pakistan, there is an increase in the area of about 1.71% because of higher output prices but production decrease by 0.65% due to heavy rains and floods (GOP, 2015a). In Pakistan, it is difficult to increase the production area of vegetable in order to increase the supply of vegetables. Cropping pattern change is a hurdle in area reallocation from major crops to minor crops like vegetables. Time and investment are needed for changing the cropping pattern which is not easy in short period of time. Moreover, social, economic, agronomical and political factors are also making problem in reallocation of area from major to minor crops (Bakhsh, 2007). In Pakistan, fruits and vegetables shows higher demand in all months. Prices of vegetables are higher in the beginning and ending of vegetable season. In order to push the prices downward, adoption of new technology and cultivation of vegetables in off-season are better options.

Source of data

There are two types of prices which are available for these commodities; the whole sale prices and the retail prices collected from Federal Bureau of Statistics, punjab. the whole sale prices for 13 commodities are available on monthly basis from january 1998 t0 july 2015. the production of tomato in punjab is available from the year 1985 to 2014 from Agriclture Statistics of punjab Book.likewise the data for area cultivated for tomatoes in punjab and yield of tomatoes is available from the years 1985 to 2014from, data utilized in report is taken obtain from the same source.

Study Objectives

Analysis

After examining graph it is concluded that series is non-stationary has an upward trend and no cyclic variation. Now let check its non-stationarity using Augmented Dickey Fuller Test.

library(tseries)
## Warning: package 'tseries' was built under R version 3.4.4
adf.test(a)
## Warning in adf.test(a): p-value smaller than printed p-value
## 
##  Augmented Dickey-Fuller Test
## 
## data:  a
## Dickey-Fuller = -5.0146, Lag order = 5, p-value = 0.01
## alternative hypothesis: stationary
acf(a)

pacf(a)

Ho: Process ‘a’ is non-stationary.

H1: Process ‘a’ is stationary.

As from output P-value=alpha (=0.01) so we reject Ho and conclude that process ‘a’ is stationary.But according to ACF plot process seems to be non-stationary so we move towards differencing.

b=diff(a,1)
plot(b,xlab= 'Time in Months', ylab='Differenced prices in Rupees', main='Monthly Price of Tomatoes',col='blue')

ACF and PACF are plotted below for recognizing appropriate model(s).

acf(b,col="black")

pacf(b,col="black")

According to ACF and PACF plots suggested models are:

ARIMA(3,1,0)

ARIMA(2,1,0)

ARIMA (3,1,1)

ARIMA(0,1,1)

Estimation

Model estimation is as follow

ARIMA(3,1,0)

m1=arima (a,order=c(3,1, 0))
m1
## 
## Call:
## arima(x = a, order = c(3, 1, 0))
## 
## Coefficients:
##           ar1      ar2      ar3
##       -0.2879  -0.2553  -0.2529
## s.e.   0.0856   0.0869   0.0850
## 
## sigma^2 estimated as 119:  log likelihood = -548.61,  aic = 1105.21

ARIMA(2,1,0)

m2=arima(a,order=c(2,1,0))
m2
## 
## Call:
## arima(x = a, order = c(2, 1, 0))
## 
## Coefficients:
##           ar1      ar2
##       -0.2396  -0.1875
## s.e.   0.0866   0.0865
## 
## sigma^2 estimated as 126.5:  log likelihood = -552.89,  aic = 1111.77

ARIMA (3,1,1)

m3=arima (a,order=c(3,1,1))
m3
## 
## Call:
## arima(x = a, order = c(3, 1, 1))
## 
## Coefficients:
##           ar1      ar2      ar3      ma1
##       -0.2227  -0.2396  -0.2406  -0.0690
## s.e.   0.3489   0.1192   0.1098   0.3569
## 
## sigma^2 estimated as 119:  log likelihood = -548.59,  aic = 1107.18

ARIMA(0,1,1)

m4=arima (a,order=c(0,1,1))
m4
## 
## Call:
## arima(x = a, order = c(0, 1, 1))
## 
## Coefficients:
##           ma1
##       -0.3777
## s.e.   0.1189
## 
## sigma^2 estimated as 126.8:  log likelihood = -553.09,  aic = 1110.18

Randomness of residuals:

To check randomness of residuals we use ACF plots for residuals.

plot (m1$residuals, col="blue" , main='Plot for Residuals of ARIMA(3,1,0)')

plot (m2$residuals, col="blue" , main='Plot for Residuals of ARIMA (2,1,0)')

plot (m3$residuals, col="blue", main='Plot for Residuals of ARIMA(3,1,1)')

plot (m4$residuals, col="blue",main='Plot for Residuals of ARIMA (0,1,1)')

From plots it seems that all process are random.

Forecasting

Forecasting procedure is follows:

library (forecast)
## Warning: package 'forecast' was built under R version 3.4.4
f1=forecast (m1, 12)
plot (f1)

f2=forecast (m2, 12)
plot(f2)

f3= forecast(m3, 12)
plot(f3)

f4= forecast(m4, 12)
plot(f4)

Now from models discussed above we have to choose one model and a model giving smallest RMSE (Root Mean Square Error) will be preferable. Note we find RMSE for holded 12 values.

c=d[146:157,3]
f11=c(82.93997,73.46262,68.92472,76.27024,77.71155,76.56911, 74.67200, 75.145521, 75.78231, 75.95796, 75.62505,75.51488)
mse1=mean((c-f11)^2)
rmse1=sqrt(mse1)
rmse1
## [1] 31.7467
f22=c(84.99727,79.83876,83.37218,83.49276,82.80135,82.94441,83.03977,82.99010,82.98412,82.99487,82.99341,82.99175)
mse2=mean((c-f22)^2)
rmse2=sqrt(mse2)
rmse2
## [1] 36.47405
f33=c(74.14848,58.57164,58.57164,58.57164,58.57164,58.57164,58.57164,58.57164,58.57164,58.57164,58.57164,58.57164)
mse3=mean((c-f33)^2)
rmse3=sqrt(mse3)
rmse3
## [1] 25.31735
f44=c( 79.92707, 79.92707, 79.92707, 79.92707,79.92707, 79.92707,79.92707,79.92707,79.92707,79.92707,79.92707,79.92707)
mse4=mean((c-f44)^2)
rmse4=sqrt(mse4)
rmse4
## [1] 34.57647

Model ARIMA(3,1,1) has smallest RMSE so it is considered to be appropriate for forecasting.

Conclusion

Thus if forecast for tomato prices is needed then suggested model is ARIMA(3,1,1), for this AIC and BIC criteria is minimum as compared to other models also it provide minimum RMSE(Residual Mean Square Error). This forecast will help farmers for future production of tomatoes because they will have idea when they should produce more for earning more.