Den Haan JME(2000)
Den Haan JME(2000)
A newer version of this is now available at:
http://www.estima.com/forum/viewtopic.php?f=8&t=1127
This is a replication for Wouter J. den Haan(2000), "The comovement between output and prices," Journal of Monetary Economics, vol 46, no 1, 3-30, for quarterly data.
Program file: Data file:
http://www.estima.com/forum/viewtopic.php?f=8&t=1127
This is a replication for Wouter J. den Haan(2000), "The comovement between output and prices," Journal of Monetary Economics, vol 46, no 1, 3-30, for quarterly data.
Program file: Data file:
Re: Den Haan JME(2000)
How do you decompose the correlation between two variable into the contributions of the structural shocks?
Re: Den Haan JME(2000)
Decomposing the covariance is relatively straightforward. If FACTOR is a factor of the covariance matrix %SIGMA, thenmtp wrote:How do you decompose the correlation between two variable into the contributions of the structural shocks?
%xrow(factor,1).*%xrow(factor,2)
will give an additive decomposition of %SIGMA(1,2), and similarly for other subscripts replacing 1 and 2.
An analogous calculation for the correlation would take the equation Fv=u and rescale both sides by the diagonal matrix which makes the variances of u equal to 1 (1/sqrt(diagonal elements of %sigma)).
dec rect rd(n,n)
ewise rd(i,j)=%if(i==j,1.0/sqrt(%sigma(i,j)),0.0)
disp %xrow(rd*factor,1).*%xrow(rd*factor,2)
Re: Den Haan JME(2000)
From your example, how do you extract the contribution of each shock from the correlation of forecast errors as implied by the VAR?
* Evaluate the forecast correlations at the base model
@ForecastCorrs(model=base,corrs=basecorr) 1960:3 *
@VARBootSetup(model=base) bootvar
dec series[vect] bootcorr
gset bootcorr 1 nboot = %zeros(ncov,1)
* Redefine the boostrap system to get the deterministic variables right
system(model=bootvar)
variables %%VARResample
lags 1 to 3
det constant trend
end(system)
* Draw the new data
@VARBootDraw(model=base,resids=resids) %regstart() %regend()
* Estimate the VAR on the bootstrapped data
estimate(model=bootvar,noprint)
@ForecastCorrs(model=bootvar,corrs=bootcorr(boot))
* Evaluate the forecast correlations at the base model
@ForecastCorrs(model=base,corrs=basecorr) 1960:3 *
@VARBootSetup(model=base) bootvar
dec series[vect] bootcorr
gset bootcorr 1 nboot = %zeros(ncov,1)
* Redefine the boostrap system to get the deterministic variables right
system(model=bootvar)
variables %%VARResample
lags 1 to 3
det constant trend
end(system)
* Draw the new data
@VARBootDraw(model=base,resids=resids) %regstart() %regend()
* Estimate the VAR on the bootstrapped data
estimate(model=bootvar,noprint)
@ForecastCorrs(model=bootvar,corrs=bootcorr(boot))
Re: Den Haan JME(2000)
I'm not sure there's a sensible way to do that. The decomposition of the forecast error for T+k given T is just the historical decomposition. For each series of interest, you will get an N-term sum. The sample covariance of two forecast errors will be the product of two N-term sums which won't give you any nice decomposition by shock. The calculations above work because they're done in population where the cross terms drop out.mtp wrote:From your example, how do you extract the contribution of each shock from the correlation of forecast errors as implied by the VAR?