Campbell Ammer JOF 1993 |
This is replication code for Campbell and Ammer(1993), through Table IV. This estimates VAR's on a set of variables and analyzes non-linear functions of a multiple-step forecast using them.
The data set consists of six variables:
ER |
excess returns on stocks (relative to one-month bills) |
R |
real interest rate |
DY |
change in one month nominal bill rate |
S |
yield spread between 10-year ZCB and one-month bills |
DP |
log dividend/price ratio |
RB |
relative bill rate (bill rate minus one year moving average) |
The unobservable variables generated by the model are the expected vs unexpected components of the excess stock returns, and expected vs unexpected components of the yield spread.
All the calculations are done over four different sample ranges: the full sample (1952:1 to 1987:2) and three subsamples. Because the calculations are identical except for range, it's controlled by the following general structure, where the ...calculation over... changes from table to table.
dec rect[integer] ranges(4,2)
compute ranges=||$
1952:1,1987:2|$
1952:1,1979:9|$
1952:1,1972:12|$
1973:1,1987:2||
compute nranges=%rows(ranges)
*
do range=1,nranges
...calculation over ranges(i,1) to ranges(i,2)
end do range
Clearly, these sample ranges are specific to this example, and in other applications, you might not even see a need to do a breakdown on the results.
table1&2.rpf
Table I is the estimate of the covariance matrix of a set of structural shocks from the six variable VAR across the sample ranges. Table II displays the corresponding estimates of the VAR lag coefficients, with (system-wide) heteroscedasticity-robust standard errors.
table3&4.rpf
Table III computes the variance decomposition of excess stock returns. This is not a decomposition of forecast error variance, but instead is a breakdown of the variance of a sum of three terms into the variances and covariances of the components (where some of the covariances can be negative). Standard errors are computed using the delta method, as the components are non-linear functions of the data and estimated VAR coefficients. The paper does the derivatives using analytical derivatives of the matrix powers, which is quite cumbersome. The RATS program uses numerical derivatives instead, which produces almost identical results with much less effort.
Table IV is similar to Table III but for excess bond returns. Note that there appears to be an error in the empirical work for the paper in constructing Table IV (not in the text, but in the authors' Gauss program). This is noted in the comments. The RATS program has that corrected.
Copyright © 2025 Thomas A. Doan