I would like to conduct a forecast based on a time series ARIMA-model with multiple exogenous variables. My time series is monthly unemployment data (in percentage) during several years and my regressors are continuous values of viewership Wikipedia traffic data on several Wikipedia articles. Both, the time series and the regressors, have the same length.

How to choose the right regressors to include in the model? Using auto.arima and forecast functions from the "forecast" package in R, my first attempt was to order the regressors according to the best resulting MAE when using each one individually. So, I start by using only 1 regressor (the best MAE), then I add the second best regressor, etc. Nevertheless, this post suggests to choose regressors according to significance but this post by Rob Hyndman suggests using AIC.

How should I proceed? How do I accept/reject regressors?

  • $\begingroup$ This is quite a frequent question, you could benefit from exploring the existing threads more. Of course, in case of conflicting advice, it is valid to ask for reassurance. $\endgroup$ – Richard Hardy Jul 28 '16 at 13:05
  • $\begingroup$ Thanks Richard Hardy, Im quite new to arima models and how this R package works with forecasts. I have found several threads. The one with more help is the one referred in my post. I just wanted to find some feedback with regard to my approach. $\endgroup$ – ruthy_gg Jul 28 '16 at 13:30
  • $\begingroup$ Understood. See also my comment under Stephan's answer. $\endgroup$ – Richard Hardy Jul 30 '16 at 16:33

The gold standard in time series model selection is to use a holdout sample. Hold out the last few months of data, fit the different models (with different combinations of regressors) to the data before that, forecast into your holdout sample and pick the model with the lowest forecast error - MAE or MSE.

That said, I would expect readership numbers of different Wikipedia articles to be correlated, especially if used as a proxy for "has a lot of time on his hands". So you might want to look at dimension reduction techniques, like principal components analysis (PCA) or similar, to reduce your regressors to only the first few principal components. Fewer orthogonal regressors will yield a more stable model and probably better forecasts. (The problem is that interpretability suffers.)

  • $\begingroup$ That was fast :) But I also think we could pick a few good threads on variable/model selection in time series and keep referring to them instead of answering each question anew. Although each situation is slightly different, so your comment on Wikipedia readership is of course valuable. $\endgroup$ – Richard Hardy Jul 28 '16 at 13:06
  • $\begingroup$ @RichardHardy: I agree. Then again, searching for the canonical answer on time series model selection takes a slight bit longer than just firing off an answer, so I usually just write the answer... contributing to even more answers and to making it even harder the next time around. I really need to work on my self-control. $\endgroup$ – Stephan Kolassa Jul 28 '16 at 13:11
  • $\begingroup$ @StephanKolassa Thanks for your answer. I do choose the best regressor based on the MAE for the holdout data (testing set) and then add the second best regressor, etc based on MAE. Sometimes it improves the MAE when I add more regressors sometimes it doesn't. Regarding the PCA suggestion, do you perhaps have a thread or an example where PCA is used when using auto.arima and xregs? Thanks $\endgroup$ – ruthy_gg Jul 28 '16 at 13:41
  • 1
    $\begingroup$ @user844924, you can just look at pure PCA literature (without auto.arima) as you would be applying PCA before supplying the first few principal components as xreg in auto.arima. $\endgroup$ – Richard Hardy Jul 28 '16 at 14:10
  • $\begingroup$ Thank you!! I have been reading many posts for PCA. My question is if the order of the components is the same order of the input variables?? Component 1 represents which variable? The first column? $\endgroup$ – ruthy_gg Jul 28 '16 at 16:37

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.