I've been using Elastic net for time series forecasting. I’m using first difference of the series. Normally I use the ACF to determine the number of lags to use. I was curious, if I would produce more lags than according to ACF, would Elastic net use them or not. Below is the ACF.

The ACF cutoff was around 13-15 lags. I decided to produce 40 lags. Then I used Elastic net and the algorithm used all the variables, also lags 15 to 40. I used 10-fold CV to tune.

enter image description here

Below is a plot of the coefficients from Elastic net regression. As you can see, it uses all the 40 lags.
enter image description here

What could be the reason for Elastic net using lags that should not affect the outcome according to ACF?

  • $\begingroup$ How did you perform cross-validation with your time series? You couldn't just hold out random subsets and expect these to be independent of the training data. $\endgroup$ – Andrew M Apr 23 '19 at 15:44
  • $\begingroup$ I´m working with the first difference of the series so I thought that I could use 10-fold CV. $\endgroup$ – Viðar Ingason Apr 23 '19 at 19:13
  • 1
    $\begingroup$ 1) use rolling origin CV, not 10 fold. Think about it, you are using lags as features so the features of your training set will be targets of your testing set. 2) what parameters did your model select? If your alpha is favoring a more ridge-like loss, the model will tend to keep all features but reduce their coefficients. On the other hand if your largest lambda evaluated isn't big enough to remove features, you'll keep all the features even with a very lasso like loss. $\endgroup$ – Barker Apr 23 '19 at 21:40
  • $\begingroup$ According to Hyndman it should be ok to use regular CV. But I´ll try rolling CV. robjhyndman.com/hyndsight/tscv $\endgroup$ – Viðar Ingason Apr 26 '19 at 19:56

Your Answer

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

Browse other questions tagged or ask your own question.