1
$\begingroup$

The high amount of cyclicality in the lynx time series makes it very difficult to model with ets and auto.arima.

library(forecast)
library(fpp2)

data(lynx)

train <- subset(lynx, end = length(lynx) - 20) # hold-out last 20 years

ets_mod <- ets(train)
arima_mod <- auto.arima(train)

fc_ets <- forecast(ets_mod, h=20)
fc_arima <- forecast(arima_mod, h=20)
fc_naive <- naive(train, h=20)

accuracy(fc_ets, lynx)
accuracy(fc_arima, lynx) # winner
accuracy(fc_naive, lynx)

autoplot(fc_arima) + autolayer(tail(lynx,20)) # poor fit

image

Questions:

  1. Are there other methods that I should try in the forecast package?

  2. How do I change the legend in autoplot() and autolayer() to show "ARIMA Forecast" and "Actual"?

$\endgroup$
3
$\begingroup$

This is a classic time series problem and there are lots of papers on it (see Tong JRSSA 1977 for an early discusson).

You could transform the series (set lambda = 0.5 for example) and you will get slightly better ARIMA results. But the main problem is that the cycles are of unpredictable length, so any model you produce will struggle to capture the aperiodic cycles. That is why the ARIMA prediction intervals are wide and approach constant values (to cover the possibility of peaks or troughs).

You will need to use a nonlinear model to get anything better than that. See Kajitani et al JF 2005 for one such model.

To answer your second question:

autoplot(train) + 
  autolayer(fc_arima, series="ARIMA Forecast") + 
  autolayer(tail(lynx,20), series="Actual")
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.