
x<ts(data$value, start=c(2009,1), end=c(2015,12), freq=12) # keep 7 months to evaluate foecast
SAR011011<arima(serie,order=c(0,1,1),seasonal=list(order=c(0,1,1),period=12));
SAR011011 #fit.an.ARIMA.model.with.no.outlier;
Coefficients:
ma1 sma1
0.3372 0.7815
s.e. 0.1166 0.2433
sigma^2 estimated as 198465069: log likelihood = 784.53, aic = 1573.06
Then I check for some outliers with the TSA package
detectIO(SAR011011)
ind 19.000000 30.000000 31.000000
lambda1 5.146045 4.250828 4.136944
So, then I added 3 outliers at theobs 19, 30 and 31
Coefficients:
ma1 sma1 IO19 IO30 IO31
0.1550 0.4761 23262.107 41275.194 20083.911
s.e. 0.1274 0.1283 8954.079 8778.279 9112.721
All of them are sigficant and really improve AIC.
So, when I tried to forecast.. most common procedures did not work.
predict(SAR011011out, n.ahead = 7, se.fit = TRUE) >data' must be of a vector type, was 'NULL'
forecast(SAR011011out, h=3)> 'data' must be of a vector type, was 'NULL'
I have read here that TSA does not have a predict function. But I just do not believe that is not possible to forecast incorporating outliers. what does the community use in this cases?
Thanks in advance!
