How many lags should I include in time series prediction? I'm wondering: how do I select the number of previous time steps to use to predict the current one?
I'm just plotting the autocorrelation plot and picking previous time steps that have statistically significant correlation with the present.
Is this a proper way of doing this? I'm basically just wondering how many time steps should I include.
 A: Looking at individual autocorrelations may help in simple cases, but this way you could miss lags that are important only jointly but not individually. Alternatively, you may try the following:


*

*Select a large number of lags and estimate a penalized model (e.g. using LASSO, ridge or elastic net regularization). The penalization should diminish the impact of irrelevant lags and this way effectively do the selection. There would be some inconvenience in that cross validation is normally used for selecting penalty intensity, and cross validation is a bit tricky with time series. But this is still doable, no doubt about it.

*Try a number of different lag combinations and either
(i) select the best of them according to an information criterion (AIC should do well in terms of forecasting as it is an efficient selector) or out-of-sample performance OR
(ii) combine some or even all of them weighting the models based on their likelihood, information criteria or the like. Refer to model averaging and forecast combination literature for detailed recipes.
(ii) would often do better than (i) in terms of forecasting, especially if you are selecting from a large number of alternatives.


Another alternative is to leave the job to some automated procedure like the auto.arima function in "forecast" package in R. The algorithm for auto.arima is available in Hyndman & Khandakar (2008).
References:


*

*Hyndman, Rob J., and Yeasmin Khandakar. "Automatic Time Series Forecasting: The forecast Package for R." Journal of Statistical Software 27.i03 (2008).

