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?

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?

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: