I have a time series of daily temperature with autocorrelation that looks like this:


Of course, temperature is heavily autocorrelated. When looking at the partial autocorrelation plot, lags are significant up to the 15th lag. Text

But now I want to use this data as input for a regression model of a dependent variable y (perhaps something like heating), and I am wondering how many lagged values of temperature I should add.


Should I add all fifteen of them? It seems a little much. Especially since I don't think the temperature of fifteen days ago will influence the amount of heating done today very much.


1 Answer 1


I will provide an explanation of how I would go about deciding the number of lag points to consider. This is exploratory in nature, it assumes that you do not have a justification (hypothesis/assumption) directing you to a specific number, and above all is, it is arbitrary. (But, the final choice for any number of lag variables would be arbitrary anyways.)

I would start with a random subset of the data, and I would run a number of models increasing the number of lag points for each model. Once I have determined when the additional lag points stopped reaching significance in the model, I would check to see if the final number of lag points all reach significance as predictors in a model with a different random subset of the data. (If I were feeling extra-adventurous, I might even draw multiple samples at each step to build more evidence on how many lags to consider.)

Then I would run the model with the entire data set. As justification that a reasonable number of lag variables have been included, the model parameter estimates should not change that dramatically if you add or subtract one of the lags.

I'm certain there are more sophisticated methods that can be employed, and I am hoping other contributors will offer other responses explaining those protocols.

  • $\begingroup$ Thanks for your explanation! I asked this question indeed with the situation of no assumptions in mind. I guess I was mostly wondering how to deal with the trade-off between including all lags, removing any autocorrelation, and preventing overfitting? $\endgroup$
    – eork
    Commented May 25, 2023 at 17:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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