Questions about BVAR/DSGE procedure

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Questions about BVAR/DSGE procedure

Postby jdavis » Tue Aug 01, 2006 9:29 pm

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
Attachments
datapull.m
the file for pulling the simulated data. This is used in the estimation file
(158 Bytes) Downloaded 153 times
lpsim.mod
The simulation file
(951 Bytes) Downloaded 157 times
lpest.mod
The estimation file
(1.45 KiB) Downloaded 160 times
jdavis
 
Posts: 5
Joined: Wed Jul 05, 2006 11:17 pm
Location: Evanston

Postby jdavis » Thu Aug 03, 2006 12:14 am

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
jdavis
 
Posts: 5
Joined: Wed Jul 05, 2006 11:17 pm
Location: Evanston

Postby MichelJuillard » Thu Aug 03, 2006 8:53 pm

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]
MichelJuillard
 
Posts: 680
Joined: Thu Nov 18, 2004 10:51 am

Postby jdavis » Fri Aug 04, 2006 9:23 pm

Hi Michel,

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

Best,
Josh
jdavis
 
Posts: 5
Joined: Wed Jul 05, 2006 11:17 pm
Location: Evanston

Postby MichelJuillard » Thu Aug 10, 2006 1:23 pm

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
MichelJuillard
 
Posts: 680
Joined: Thu Nov 18, 2004 10:51 am


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 10 guests