Page 1 of 1

Questions about BVAR/DSGE procedure

PostPosted: Tue Aug 01, 2006 9:29 pm
by jdavis
I am getting a very odd result for the BVAR /DSGE procedure in dynare and hope that someone here can help me out.

In particular I am interested in simulating data from a hybrid model and checking for the 'lambda' weight that maximizes the marginal density on this simulated data.

When I do this with the Rabanal and Rubio-Ramirez (2003) example included with dynare I find that the exercise produces the correct answer.

When I carry out the same exercise in a very simple model, in this case the Long and Plosser model which has an exact log-linear solution (due to full depreciation of capital), I get the wrong answer. For example, simulating data from a dsge model and estimating lambda on the generated data yields lambda=0 (all the weight is on the VAR).

I am wondering why it would be the case that the code is working correctly in the more complex model but doesn't in the small model. Could dynare have a mistake or does the procedure have problems with robustness?

Also, I am finding the marginal density calculation that uses the modified harmonic mean does not work with the BVAR/DSGE procedure (specifying mh_replic>0). In this case it is only possible to approximate the marginal density using Laplacian approximation. Does the 'Laplacian Approximation' correspond to laplacian quadrature?

Thanks in advance,
Josh

PostPosted: Thu Aug 03, 2006 12:14 am
by jdavis
I think I have found the reason for the odd results I report above. The policy rule contains a constant vector. When I set the constant vector to zero I get the correct result. When this vector is nonzero I get the strange result. For some reason the model is simulating correctly with the constant though the estimation isn't correct with the constant. Can someone let me know why this would be the case?

Thanks in advance,
Josh

PostPosted: Thu Aug 03, 2006 8:53 pm
by MichelJuillard
When you are writing
Code: Select all
gammak=((1-alph)/(1+psi))*log((1-alph)/(1-bet*alph)) + log(bet*alph);
gammaa=-(alph/(1+psi))*log((1-alph)/(1-bet*alph));


in the parameter initialization section of the *.mod file, gammak and gammaa are initialized only once with the original value of psi, but their value doesn't change when the value of psi changes thru estimation.

When one has functions of deep parameters as here, one should write the derived parameters definition inside the model block with a pound sign (#) to distinguish it from an equation:
Code: Select all
model(linear);
#gammak=((1-alph)/(1+psi))*log((1-alph)/(1-bet*alph)) + log(bet*alph);
#gammaa=-(alph/(1+psi))*log((1-alph)/(1-bet*alph));
    a     = gammaa + alph*k(-1) + (1-alph)*z + alph/(1+psi)*x;
    k     = gammak + alph*k(-1) + (1-alph)*z - (1-alph)/(1+psi)*x;
end;


Best

Michel[/code]

PostPosted: Fri Aug 04, 2006 9:23 pm
by jdavis
Hi Michel,

I followed your advice but it doesn't change my result. Could there be any other explanation?

Best,
Josh

PostPosted: Thu Aug 10, 2006 1:23 pm
by MichelJuillard
Dear Josh,

when you run lpest on your simulated data, you get the following score:
score =

1.0e+005 *

0.00000100000000 0.01121016123859
0.00000500000000 0.01102629039829
0.00001000000000 0.01075263664753
0.00002000000000 0.01021631063462
0.00010000000000 0.00621955891170
0.10000000000000 -2.29939808969458

You do find that the highest (positive) score is indeed for lambda close to 0

For lambda = 10000, Dynare fails to find a proper mode and return a meaningless (very low) value for the marginal density.

Best

Michel