# How many lags should I include in a VAR model?

When building a VAR-model with six variables and 117 observations, I had the following situation: after building a VAR(1), the overall portmanteau test says that the residuals are OK ($$p=0.85$$, $$p_\textrm{adjusted}=0.22$$). But when I have a look at the single residuals the ACFs all look white noise except one of the six in my case. For this only one it seems like I need a VAR(2) -- and portmanteau test for this single residual shows: $$p=0.067,~p_\textrm{adjusted}=0.029.$$

I'm unsure what to do in this situation. I experienced the same situation in another VAR where one residual looked like including 5 lags.

So the first question is, how do I decide if 1 lag is enough or if I need 2 lags?

Next: If I decide that it takes 2 lags, do I then have to let the model estimate the whole matrix even if there is only one variable that needs the second lag? Or is it reasonable to allow for the matrix of the second lags only the specific row (and/or column) belonging to this variable? Like in the picture below - imagine only variable E shows elevated autocorrelation at lag 2; the picture is only for showing the problem, normally there is a constant included and deterministic trend terms, too.

What to do in the case of one residual showing only lag 5 to include additionally? Then I would not include the matrices for lags 2, 3 and 4 and only for 5?

What goes in the same direction: if I first include only intercepts and deterministic trends and see that some residuals are already WN, then does it make sense to include any predictors for them? Should I include higher lags only for the variables where the residuals show it?

NOTE: $$p$$ and $$p_\textrm{adjusted}$$ are calculated as follows:

\begin{align}Q_h &=T\sum_{j=1}^h\operatorname{tr}\left(\hat C_j^\prime\hat C_0^{-1}\hat C_j\hat C_0^{-1}\right)\\ Q^\ast_h &=T^2\sum_{j=1}^h\frac1{T-j}\operatorname{tr}\left(\hat C_j^\prime\hat C_0^{-1}\hat C_j\hat C_0^{-1}\right).\end{align}

• @RichardHardy: maybe you can help me again :)
– eski
Mar 20, 2015 at 16:11
• I wonder how is p_adjusted defined? Mar 20, 2015 at 21:03

Regarding the first question, different equations of a VAR model need not have the same lag order. Each equation is meaningful by itself and can be treated separately (as regards estimation). If you find that one of the equations may benefit from including some more regressors, you may as well do that.

Regarding the picture, I can understand why you have one full row in the lag 2 matrix, but why do you also have one full column? Based on what you have told, that seems unnecessary.

Regarding lag 5, is it plausible that there could be an effect with lag 5? (This is a subject-matter question.) If yes, then consider including just lag 5; including all the lags in between 1 and 5 would not be a parsimonious solution. And you should care about parsimony since your sample is quite small. If lag 5 is quite implausible, maybe the significant autocorrelation at that lag is a false positive that is due to chance?

Keep in mind that trying to fit the data very well may lead to overfitting. Using information criteria such as AIC or BIC could help decide between a few sensible candidate models. That means that you would deliberately accept ill-behaved model errors when including extra parameters is too costly due to increased estimation uncertainty. That should give some overall guidance as well as address the questions in the last paragraph.

• I don't know exactly why I thought of the column, too... I was asking myself exactly this question - if only the row makes sense... Now I know that it is like that. So again something concerning my last question: can one say that if a series is already white noise after including an intercept (and deterministic trends) that it does not make sense to include lag 1 or more for this variable? Or is it reasonable to include regressors even if it is white noise? I don't think so... because is there is no unexplained structure left in the series.
– eski
Mar 21, 2015 at 11:54
• If you obtain white noise without including own lags, including own lags would not make much sense. On the other hand, other regressors may still be used to explain variation even in a white noise series (because white noise is a property associated with the variable itself but disregards other variables). You could use AIC or BIC to see if including an extra regressor is worth it. Mar 21, 2015 at 12:17
• ok, fine! So if I got it right the following proceedings would be good: 1) start with building a VAR(0) with only the intercepts and determinstic trends (same as univariate analysis) 2) if there is meaningful autocorrelation left in a single residual then include the suitable lag(s) in this specific equation (only for the rows); or try including even if white noise and look for AIC/BIC
– eski
Mar 21, 2015 at 12:27
• I would not generalize it as much as to make it a VAR model building strategy; there are established strategies that I would go for first. You already had a reasonable start: choose a common lag order for the whole VAR model using AIC or BIC, then examine separate equations and see if they are seriously lacking, and tweak them a bit. The general problem with building VAR models is that there are quite many potential regressors; examining many combinations of them may be data dredging. I would be careful not to depart too much from textbook techniques of VAR model building. Mar 21, 2015 at 12:36