I would like to know how I can determine the appropriate amount of lags in Matlab or another statistical package. I'm getting confused with VAR models and ARMAX models all the time and I'm a little stuck to be honest. Introduction on ADL models at wikipedia: http://en.wikipedia.org/wiki/Distributed_lag

Example of my issue: I have one measure based on prices and one measure based on news. I expect a linear relationship between both but I expect the news based measure to be lagged to the price effect therefore I want to try to do a linear regression with the lagged news measures to the non-lagged price measure to check how the coherence (R-squared) changes. I expect the lag to be 3-5 days so that is what I want to check (also some autocorrelation could be present). I would like to do this without manually adding regressors (general-to-specific/specific-to-general) but with some model selection criteria for the number of lags if this is possible for the ADL(p,q). Still remains unclear to me how I should handle this.

  • $\begingroup$ you might want to check out Forecasting with Dynamic Regression Models by Pankratz, this book is full of examples on ADL (p,q) or you could refer a chapter in the book on dynamic regression - Forecasting: Methods and Applications by Spyros G. Makridakis, Steven C. Wheelwright and Rob J Hyndman. Also, you might want to ask this type of question with a reproducible example. $\endgroup$
    – forecaster
    Aug 12, 2014 at 22:56
  • $\begingroup$ Thank you very much for your suggestion I'll look into the Pankratz book. I updated the question with an example of what I want to check. $\endgroup$
    – BigChief
    Aug 13, 2014 at 5:16

1 Answer 1


You could use cross-correlation analysis (CCF) to identify leading and lagging variables and max lag between them.

When you have found this out you can build a model with lags P, P+1, P+2, ... until current time.

Parameter restrictions can be tested as usual with F-test which tests restricted model against full-model.

You perhaps have to first prewhiten variables before CCF-analysis, since autocorrelation structure can affect analysis.

In any case you have to test residuals that they are IID.

  • $\begingroup$ Thanks for your answer!! Pankratz writes something about it but does not help me very much. So what you say is I should first check for autocorrelation (acquiring autocorrelation lag order with pacf/acf), then use prewhitening, and finally I could use mathworks.nl/help/signal/ref/xcorr.html (biased or unbiased) for the lags with the independant variable?? Could I use one of these for prewhitening? (want to fix this in stat package): naufraghi.googlecode.com/svn-history/r241/dottorato/drtoolbox/… github.com/casperkaae/MATLAB/blob/master/drtoolbox/prewhiten.m $\endgroup$
    – BigChief
    Aug 13, 2014 at 8:08
  • $\begingroup$ sorry only pacf right because we look in ADF only at AR & lags of variables and not at moving averages? $\endgroup$
    – BigChief
    Aug 13, 2014 at 8:21
  • $\begingroup$ sorry to bother you again but could you provide me with a paper or other source where your method is used?? I think your method is very well doable but I lack some reading material very badly (and sources) $\endgroup$
    – BigChief
    Aug 13, 2014 at 20:52
  • 1
    $\begingroup$ You must first identify an ARIMA or AR(p) model for the x variable and get white noise residuals. Then you filter y series by this same model and get "residuals" which probably are not white noise. Then you do bivariate cross-correlation analysis with "residuals" of x and y series. Model for x series can be identified by ACF/PACF. Here is link to this method: onlinecourses.science.psu.edu/stat510/node/75 $\endgroup$
    – Analyst
    Aug 14, 2014 at 4:56
  • $\begingroup$ @BigChief, perhaps you could give me upvote? :) $\endgroup$
    – Analyst
    Aug 15, 2014 at 5:23

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.