Page 1 of 1

Den Haan JME(2000)

Posted: Mon Mar 22, 2010 3:18 pm
by TomDoan
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:
bqfor.prg
(4.84 KiB) Downloaded 1203 times
Data file:
quarterly.xls
(60.87 KiB) Downloaded 1166 times

Re: Den Haan JME(2000)

Posted: Fri Jul 01, 2011 11:41 am
by mtp
How do you decompose the correlation between two variable into the contributions of the structural shocks?

Re: Den Haan JME(2000)

Posted: Fri Jul 01, 2011 4:56 pm
by TomDoan
mtp wrote:How do you decompose the correlation between two variable into the contributions of the structural shocks?
Decomposing the covariance is relatively straightforward. If FACTOR is a factor of the covariance matrix %SIGMA, then

%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)

Posted: Sat Jul 02, 2011 2:51 am
by mtp
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))

Re: Den Haan JME(2000)

Posted: Tue Jul 05, 2011 12:49 pm
by TomDoan
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?
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.