Likelihood only!

I entered it like this

estimation(order=1, datafile=usmodel_data_eget, mh_replic=10, mh_nblocks=2, mh_jscale=0.8,
use_univariate_filters_if_singularity_is_detected=0, nograph, nodiagnostic);

It seems like that did the trick. The extremly high likelihood values now got the error value instead i.e -1e+8.

Nice work!!

\Glm

I am trying to do do the exact same thing as earlier, i.e. running the mod-file with the purpose of getting the likelihood value only. The difference this time is that instead of a pure Maximum likelihood I’ve added the same priors as Smets and Wouters (2007). But now the usual way doesn’t seem to work at all. Is there a way to fix this? I’ve attached both files, the usual maximum likelihood mod-file called “s_and_w_ml.mod” and the one with priors “s_and_w_prior.mod”

\\Glm
Replicate Smets and Wouters (2007).zip (18 KB)

I forgot to add one file, “min_max_funk”. It’s added here.

\\Glm
min_max_funk.m (363 Bytes)

What exactly is the problem?

I wanna get the likelihood value for some paramater vector “xparam”. This works fine when I have a 100 % maximum likelihood mod file. But when I add priors, for instance if I replace the first row of the “estimated_params” block like this (in the s_and_w_ml.mod file):

csadjcost,6.3325,tres(1,1),tres(1,2);

and replace it with the prior

csadjcost,6.3325,2,15,NORMAL_PDF,4,1.5;

It doesn’t work any more and I get the error that it can’t find the distribution “NORMAL_PDF”

You cannot have a mixture. You must either go full ML or full Bayesian. Everything in between will crash.

Oki. But I also tried a full Bayesian where I put priors on all parameters (that’s the only difference between “s_and_w_ml.mod” and “s_and_w_prior.mod”). Although it doesn’t work the same way that “s_and_w_ml.mod” does, that is, allows me to evaluate the likelihood value only for a given parameter vector.

Then provide the final file that does not work.

No worries, I found the problem myself. Some of the parameters were outside of the prior bounds which in turn generated the error log likelihood -1e+8.

But thanks anyways for all your help!

\\Glm

If i write like this in the parameter block

constebeta=0.16;
cbeta=1/(1+constebeta/100);

and like this in the model block

xcbeta=gamma+yzeta;

will Dynare take into account that cbeta is a function of constebeta when I estimate with regard to constebeta?

\\Glm

Calibration only once updates the other parameters depending on the estimated one. That’s why you should use model-local variables (the ones with the pound operator) or a steady state file. See Remark 4 (Parameter dependence and the use of model-local variables) in Pfeifer(2013): “A Guide to Specifying Observation Equations for the Estimation of DSGE Models” .