I am using the forecast
package in R to do ARIMA forecasting with auto.arima()
function by Professor Hyndman.
I have 27 months of sales data (June 2014 to August 2016), I'm using the first 21 months as training set, and the rest 6 months as test set.
dataset <- c(380075, 367137, 320548, 290192, 256514, 365335, 356847, 287760, 378703, 415378, 331637, 228744, 407655, 496475, 340695, 410041, 725069, 594173, 614646, 530843, 565057, 487604, 565945, 410603, 405337, 283004, 211718)
datasets = ts(dataset, start=c(2014,6), frequency=12)
trainsets <- window(datasets, end=time(datasets)[length(dataset)-6])
testsets <- window(datasets, start=time(datasets)[length(dataset)-5])
fit <- auto.arima(trainsets, ic='aic', D=1, seasonal=TRUE, approximation=FALSE,trace=TRUE, stepwise=FALSE, allowdrift=FALSE)
WA <- forecast(fit, 6)
And I got the return
> fit
Series: trainsets
ARIMA(1,0,0)(0,1,0)[12]
Coefficients:
ar1
0.7148
s.e. 0.1989
sigma^2 estimated as 2.489e+10: log likelihood=-120.32
AIC=244.63 AICc=246.63 BIC=245.03
> WA
Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
Mar 2016 548576.1 346405.21 750747.0 239382.42 857769.8
Apr 2016 426841.5 178337.38 675345.5 46787.27 806895.6
May 2016 296792.2 27678.71 565905.7 -114781.35 708365.7
Jun 2016 456293.0 177237.44 735348.6 29514.34 883071.7
Jul 2016 531239.4 247238.93 815239.9 96898.14 965580.7
Aug 2016 365543.2 79049.34 652037.0 -72611.33 803697.7
I tried to do the manual calculation to understand the output, so because I have ARIMA(1,0,0)(0,1,0)[12]
So I expect the calculation to be
$$\hat{Y_t}(1) = \mu + \phi*(Y_{t-1} - Y_{t-2}) + Y_{t-12}$$
I think I can leave the $\mu$ = 0
So, for the March 2016 with the forecast of 548576.1, I calculate
$$\hat{Y_t}(MARCH2016) = 0 + 0.7148*(FEB2016 - JAN2016) + MARCH2015$$ $$\hat{Y_t}(MARCH2016) = 0 + 0.7148*(565057 - 530843) + 415378$$ $$\hat{Y_t}(MARCH2016) = 589513.1672$$
Question : What makes my calculation doesn't meet the correct forecasting? Can you please suggest me the right way to calculate the function?
Thank you.