RATS 10.1
RATS 10.1

Procedures /

VARLAGSELECT Procedure

Home Page

← Previous Next →

@VARLAGSelect is a procedure for selecting the lag length in a VAR using one of several techniques. Several things to note:

1.While it's provided as an option, CRIT=GTOS (General-to-Specific) is not a good method for automatic lag selection in a VAR—it tends to pick lag lengths that are too long for practical purposes.

2.All the methods assume the underlying model has a fixed covariance matrix (and the information criteria assume, in addition, Gaussian residuals) so they aren't strictly valid in the presence of heteroscedastic errors in general and GARCH errors in particular. Again, the tendency is for those to result in picking a longer lag length than is needed.

3.As a general rule, you shouldn't use automatic lag length selection if the goal is to choose a VAR to study the dynamics of the data (with impulse responses and the like). Instead, pick a reasonable lag length for the data (such as 4 for quarterly, 6 or 12 for monthly). Automatic lag length selection makes more sense if the joint serial correlation is considered to be a "nuisance" to the topic of interest (such as cointegration).

4.Make sure your maximum lag length is reasonable for the size of the model and the amount of data that you have. The example below has 142 original data points, dropping to 141 due to differences in the transformations. With 8 lags in the longest VAR, you have 133. With 8 lags in a four variable model (plus the constant), you have 33 regressors per equation, so it's using about 1/4 of the available data points. If you went to 12 lags (which is almost certainly too many for quarterly data), you would lose 4 more data points due to lags (to 129) and are up to 49 regressors in the largest model, so that's close to 40% of the data points. That's probably too many to get reliable estimates. Most likely a lag length that long would be rejected anyway, but there is no point in losing the added data points at the start of the sample for models that you aren't going to pick.

5.This is specific to a full VAR with either a constant as the only deterministic variable, or no deterministics (with the DET=NONE option). If you need some other type of multivariate model, look at the VARLAG.RPF program and adjust the model estimated in the final loop.

 

@VARLagSelect( options ) start end

# list of variables

Parameters

start,end

Estimation period used for all models. If you have not set a SMPL, this defaults to the maximum range taking into account the (maximum) number of lags.

Options

LAGS=(maximum) number of lags [1]

 

DET=NONE/[CONSTANT]

Deterministic variables to include

 

CRIT=AIC/SBC/BIC/HQ/GTOS/[NONE]

Criterion to use in selecting the lag length (SBC and BIC are synonyms). GTOS does a general to specific pruning using LR tests dropping lags as long as the final one fails to be significant at the level indicated by the SIGNIF option. If NONE, it just estimates the model with the specified number of lags.

 

SIGNIF=marginal significance level used in GTOS pruning [.05]

 

MODEL=model to define from chosen lag length [not used]

[PRINT]/NOPRINT

TITLE=title for output ["VAR Lag Selection"]

Variables Defined

%%AUTOP

chosen number of lags

Example

*

* FVOP254.RPF

* VAR, Gold and silver data

*

cal(m) 1978:1

open data "GSCI_gold_and_silver.xlsx"

all 2012:12

*

* Data on file are daily. Compact by monthly averages of daily

* values.

*

data(format=xlsx,org=columns,top=2,compact=average) / gssitot gsgctot

*

set lgold   = log(gsgctot)

set lsilver = log(gssitot)

*

@varlagselect(lags=5,crit=aic) 1986:1 2012:12

# lgold lsilver

@varlagselect(lags=5,crit=sbc) 1986:1 2012:12

# lgold lsilver

*

system(model=varmodel)

variable lgold lsilver

lags 1 2

det constant

end(system)

*

estimate 1986:1 2012:12

Sample Output

This is the output from the two @VARLAGSELECT calls in the above. For the various information criteria, the calculated IC's for each lag are shown, with the minimizer marked with a *.

 

VAR Lag Selection

Lags AICC

   0  0.6374162

   1 -7.0668489

   2 -7.1165879

   3 -7.1176427*

   4 -7.1043929

   5 -7.0868147


 

VAR Lag Selection

Lags SBC/BIC

   0  0.6606967

   1 -6.9972396

   2 -7.0009642*

   3 -6.9563251

   4 -6.8977079

   5 -6.8350950


 


Copyright © 2024 Thomas A. Doan