Title: Estimating a VAR
1Estimating a VAR
- After making the necessary data transformations,
you must define the equations to use in the VAR.
Typically, you will use the following five
instructions to set up a VAR - SYSTEM(modelmodelname)
- or SYSTEM 1 to number of equations in the
system - VARIABLES list of dependent variables
- LAGS 1 to lag length
- DETERMINISTIC list of deterministic (constant,
- seasonals) and exogenous variables
- END(SYSTEM)
2Example for estimating a VAR
As illustrated in the Programming Manual, you can
set up a 3-variable VAR for the variables dlrgdp,
dlrm2, and drs using system(modelvar1) var
dlrgdp dlrm2 drs lags 1 to 12 det
constant end(system) The SYSTEM and VARIABLES
(i.e., var) instructions set us a system of VAR
equations called var1. Here the lag length is 12
and each regression equation includes a constant.
Next, use ESTIMATE to obtain the results, save
the residuals in the series resids12, and to save
the variance/covariance matrix in
V estimate(residualsresids12,outsigmaV)
3Creating Seasonals
ENTRY DECEMBER 197201 0
197202 0 197203 0 197204
0 197205 0 197206 0
197207 0 197208 0 197209
0 197210 0 197211 0
197212 1
cal 1972 1 12 all 199910 open data
f\classes\413\2000\cars.txt data(formatprn,orgo
bs) / seasonal december pri / december lin
cars constant december0 to 10
4estimate(OUTSIGMAV,other options) start end
residuals where start end The range of entries
to use. residuals The residuals from the first
equation are stored in the series given by
residuals, the residuals from the second equation
are stored in series number residuals1, and so
forth. The appropriate number of series should
be declared on the ALLOCATE instruction.
OUTSIGMA The name of the variance/covariance
matrix. This option computes and saves the
covariance matrix of the residuals. You must use
this option if you want to perform innovation
accounting or hypothesis tests  The other
principal options are NOPRINT By default, RATS
prints out the results of the OLS estimation of
each equation. Use NOPRINT to
suppress the output. NOFTESTS By default, RATS
prints the results of all Granger causality
tests. Use to supress this output. SIGMA
This option computes and displays (but does not
save) the covariance matrix of the residuals.
Use both OUTSIGMA and SIGMA if you want to
compute, save, and print the variance/covariance
matrix.
5Impulse Responses and Variance Decompositions
errors(IMPULSES) equations steps name where
equations Number of equations in the VAR.
steps The forecast horizon and the number of
impulse responses. name The name of the
covariance matrix used on the ESTIMATE
instruction. Â The principal option is IMPULSES.
If you exclude IMPULSES, RATS calculates and
prints only the variance decompositions. There
is a supplementary card for each equation
6Hypothesis Testing in RATS
ratio(degreesdf ,mcorrc,other options) start
end 1 2 ... n n1 n2 ... 2n  where start
end The range over which the test is to be
performed. degrees The number of degrees of
freedom (equal to the number of restrictions in
the system). mcorr Sims small sample
correction for likelihood ratio tests (i.e., the
value of c). Set mcorr equal to the largest
number of parameters estimated in any one of the
equations (usually equal to the number of
parameters estimated in each of the unrestricted
equations). Â NOPRINT, supresses the printing
of the covariance matrices and the marginal
significance level of the test. It is possible to
obtain the marginal significance level with the
instruction  display signif
7Example of a Cross Equation Restriction
Example Suppose, a two-variable VAR using 12
lags of each variable is estimated and the
residuals are saved in series 1 and 2. The
estimation is over the sample period 632 to
914. Next, the same sample period is used to
estimate a model with a lag length of 8 and the
residuals are saved in series 3 and 4. The lag
length test is conducted using ratio(degrees16,
mcorr28) 632 914 1 2 3 4
8Multivariate AIC and SBC
When you use the OUTSIGMA option on the ESTIMATE
statement, RATS computes the covariance matrix of
the residuals. You can fetch the logarithmic
determinant of this covariance matrix using
LOGDET. compute aic nobslogdet
2N compute sbc nobslogdet
Nlog(nobs) display aic aic sbc
sbc where you must set N equal to the number of
parameters estimated in the entire system
9Seemingly Unrelated Regressions
Different lag lengths yt a11(1)yt-1
a11(2)yt-2 a12zt-1 e1t zt a21yt-1 a22zt-1
e2t
Non-Causality yt a11yt-1 e1t zt a21yt-1
a22zt-1 e2t
Effects of a third variable yt a11yt-1
a12zt-1 e1t zt a21yt-1 a22zt-1 a23wt
e2t
10Estimating a Near-VAR
Step 1 As in Step 1 of a VAR estimation, use the
ALLOCATE instruction to reserve room for each of
the residual series. Step 2 You must define
the equations to use in the near-VAR. The
simplest way is to use the DEFINE option of the
LINREG instruction. To set up the first near-VAR
system above, use linreg(define1) y y1 to
2 z1 linreg(define2) z y1 z1 To set up
the third near-VAR system above,
use linreg(define1) y y1 z1 linreg(define
2) z y1 z1 w
11Near-VAR II
Step 3 The typical syntax of SUR is
sur(options) equations start end equation
resids  where equations The number of
equations in the system start
end The range of entries to use.
equation The number of the equation.
resids The series in which to store the
residuals. There is 1 supplementary instruction
for each equation.