Calculating the Likelihood

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.

Calculating the Likelihood

Postby mjs19 » Wed Mar 04, 2015 12:59 pm

Hi,
I am trying to obtain the likelihood for different parameter values as suggested here: viewtopic.php?f=1&t=5547.

However, I keep getting some weird, large positive value. I have attached the code and datafile.

Thanks.
Attachments
data.m
Saved as m-file since I can't attach a .mat...
(1.35 KiB) Downloaded 60 times
neoclassical_without_labor.mod
(1.06 KiB) Downloaded 83 times
mjs19
 
Posts: 16
Joined: Sat Jan 17, 2015 7:25 pm

Re: Calculating the Likelihood

Postby jpfeifer » Wed Mar 04, 2015 1:22 pm

First of all, your data is weird. The steady state in your model is about 2.3 while the mean of your data is 12. Regarding the positive values, note the sign convention in Dynare. The unstable version is more explicit. It says:
Final value of minus the log posterior (or likelihood):187.244057

Thus, the posterior is actually negative (although positive values are also possible, see e.g. http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=2847)
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Calculating the Likelihood

Postby mjs19 » Wed Mar 04, 2015 1:28 pm

So you mean that the value of the variable likelihood as in:
Code: Select all
[likelihood,junk1,junk2,exit_flag,ys,trend_coeff,info] = dsge_likelihood(xparam1,dataset_,options_,M_,estim_params_,bayestopt_,oo_);

is negative?
Or should I just read off from Dynare`s output somewhere?If that is the case, how can I tell Dynare to evaluate likelihood at different parameter values?
Thanks.
mjs19
 
Posts: 16
Joined: Sat Jan 17, 2015 7:25 pm

Re: Calculating the Likelihood

Postby jpfeifer » Sun Mar 08, 2015 8:52 am

The output value of
Code: Select all
dsge_likelihood

is minus the log-likelihood/log-posterior, because we operate a minimizer and not a maximizer on that function.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare help

Who is online

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