#8.8 Consider austa, the total international visitors to Australia (in millions) for the period 1980-2015.
library(fpp2)
data(austa)
length(austa)
autoplot(austa)
Since there is not a seasonal time series, we can set seasonal = FALSE.
ARIMA(0,1,1) is given by auto funciton. It is a random walk and a moving average sequence combination. The model is y(t) = 0.1735 + 0.3006 y(t-1)
fita<-auto.arima(austa,seasonal = FALSE)
fita
tsdisplay(residuals(fita), lag.max = 45, main = "(ARIMA(0,1,1) model residuals" )
fita %>% forecast(h=10) %>% autoplot(include=80)
After removed the drift, the Forecasts shifted down 0.1735.
#remvoe the drift
austa_b<-austa-0.1735
fitb<-auto.arima(austa_b,seasonal = FALSE)
fitb %>% forecast(h=10) %>% autoplot(include=80)
ARIMA(2,1,3) is a autoregression, a random walk, a 3-moving average sequences combination. The model is
y(t) = c + 0.0004 * y(t-1) + 0.9996 * y(t-2) + 0.4633 e(t-1) - 0.9893 * e(t-2) - 0.4625 * e(t-3)
fitc<-arima(austa,order = c(2,1,3),method="ML")
fitc
fitc %>% forecast(h=10) %>% autoplot(include=80)
After remove the constanct( mean ), arima(2,1,3) keeps the same shape and shift down.
#mean is constant
austa3<-austa-mean(austa)
fitc_2<-arima(austa3,order = c(2,1,3),method="ML")
fitc_2
fitc_2 %>% forecast(h=10) %>% autoplot(include=80)
fitd<-arima(austa,order = c(0,0,1),method="ML")
fitd
fitd %>% forecast(h=10) %>% autoplot(include=80)
Plot after remove the MA term.
fitd_2<-arima(austa,order = c(0,0,0),method="ML")
fitd_2
fitd_2 %>% forecast(h=10) %>% autoplot(include=80)
fite<-arima(austa3,order = c(0,2,1),method="ML")
fite
fite %>% forecast(h=10) %>% autoplot(include=80)