0

I'm having trouble doing a forecast based on previous data. I have data that represents eight years worth of monthly data $(n=96)$, for number of sales. I want to forecast the next 12 months based on this data using an optimal linear forecast, and I want to provide the variance of this forecast.

Here is the data

-1.96
-2.3
-2.61
-2.62
-2.38
-1.9
-1.35
-0.98
-0.65
-0.53
-0.82
-1.19
-1.39
-1.19
-0.93
-1.11
-1.51
-1.8
-1.43
-0.79
0.05
0.36
0.58
0.44
-0.15
-0.88
-1.54
-1.93
-2.18
-1.88
-1.43
-1.15
-1.48
-1.47
-1.24
-0.97
-0.65
-0.37
-0.24
-0.07
-0.09
0.4
0.83
0.98
0.96
0.29
-0.13
-0.94
-1.16
-0.37
0.05
0.18
-0.53
-0.91
-1.11
-1.28
-1.34
-1.64
-1.06
-0.15
0.34
0.14
0.42
0.44
0.05
-0.83
-1.54
-1.58
-1.27
-1.58
-1.37
-0.74
-0.72
-0.77
-1.21
-1.8
-1.74
-1.3
-0.56
0.15
0.86
1.39
2.05
2.24
2.08
1.58
1.23
0.64
0.34
0.34
0.71
1.23
1.69
1.78
2.03
2.13

I want to forecast this using either an AR, MA, or ARMA model in R but am not completely sure how to approach this. I know I need to estimate the autocovariance matrix, and I will make the assumption that the autocovariance is zero at lag h > 36. I'm also struggling with what order of the model to use.

  • Well, first you have to find out which of the three models fit the data the best and with what amount of lags. You can plot the autocorrelation function with the acf function from the stats package. A good first approach is to look at the acf of the data, of the absolute value of the data and the squares of the data. Have you done that yet? Have you checked for stationarity? You can then fit your data to an ARMA model with the function arima (from stats). The package TSA has a function armasubsets that can be useful for choosing the number of AR and MA terms. – Therkel Nov 03 '17 at 07:59
  • I cannot really tell your level of expertise and exactly what you are asking, so forgive me if the previous comment was nonsense. In such case, please expand your question with more information about what you know and have tried (or want to do, but don't know how to do in R). – Therkel Nov 03 '17 at 07:59

0 Answers0