Download presentation
Presentation is loading. Please wait.
Published byLinette Dennis Modified over 9 years ago
1
Estimating 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(model=modelname) 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) Vector Autoregressions1
2
2 Example 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(model=var1) 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(residuals=resids12,outsigma=V)
3
Vector Autoregressions3 Creating Seasonals cal 1972 1 12 all 1999:10 open data f:\classes\413\2000\cars.txt data(format=prn,org=obs) / seasonal december pri / december lin cars # constant december{0 to –10} ENTRY DECEMBER 1972:01 0 1972:02 0 1972:03 0 1972:04 0 1972:05 0 1972:06 0 1972:07 0 1972:08 0 1972:09 0 1972:10 0 1972:11 0 1972:12 1
4
Vector Autoregressions4 estimate(OUTSIGMA=V,other options) start end residuals where: start endThe 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 residuals+1, 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.
5
Vector Autoregressions5 Impulse Responses and Variance Decompositions errors(IMPULSES) equations steps name where: equationsNumber of equations in the VAR. steps The forecast horizon and the number of impulse responses. nameThe 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
6
Vector Autoregressions6 Hypothesis Testing in RATS ratio(degrees=df,mcorr=c,other options) start end # 1 2... n # n+1 n+2... 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
7
Vector Autoregressions7 Example 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 63:2 to 91:4. 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(degrees=16,mcorr=28) 63:2 91:4 # 1 2 # 3 4
8
Vector Autoregressions8 Multivariate 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 = %nobs*%logdet + 2*N compute sbc = %nobs*%logdet + N*log(%nobs) display ‘aic =‘ aic ‘sbc =‘ sbc where you must set N equal to the number of parameters estimated in the entire system
9
Vector Autoregressions9 Seemingly Unrelated Regressions Different lag lengths y t = a 11 (1)y t-1 + a 11 (2)y t-2 + a 12 z t-1 + e 1t z t = a 21 y t-1 + a 22 z t-1 + e 2t Non-Causality y t = a 11 y t-1 + e 1t z t = a 21 y t-1 + a 22 z t-1 + e 2t Effects of a third variable y t = a 11 y t-1 + a 12 z t-1 + e 1t z t = a 21 y t-1 + a 22 z t-1 + a 23 w t + e 2t
10
Vector Autoregressions10 Estimating 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(define=1) y # y{1 to 2} z{1} linreg(define=2) z # y{1} z{1} To set up the third near-VAR system above, use: linreg(define=1) y # y{1} z{1} linreg(define=2) z # y{1} z{1} w
11
Vector Autoregressions11 Near-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 endThe range of entries to use. equationThe number of the equation. residsThe series in which to store the residuals. There is 1 supplementary instruction for each equation.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.