Bayesian Estimation \

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.

Bayesian Estimation \

Postby hjawara » Thu May 30, 2013 12:32 pm

I am trying to estimate a RBC for emerging market economies model with a bayesian estimation without success. I was get the following error message when try to run the model on dynare.
??? Error using ==> chol
Matrix must be positive definite.

Error in ==> metropolis_hastings_initialization at 68
d = chol(vv);

Error in ==> random_walk_metropolis_hastings at 69
[ ix2, ilogpo2, ModelName, MhDirectoryName, fblck, fline, npar, nblck, nruns,
NewFile, MAX_nruns, d ] = ...

Error in ==> dynare_estimation_1 at 931
feval(options_.posterior_sampling_method,objective_function,options_.proposal_distribution,xparam1,invhess,bounds,dataset_,options_,M_,estim_params_,bayestopt_,oo_);

Error in ==> dynare_estimation at 70
dynare_estimation_1(var_list,dname);

Error in ==> fin_bayes1 at 283
dynare_estimation(var_list_);

Error in ==> dynare at 120
evalin('base',fname) ;

So I will be greatful if someone can help. The dynare cmd file
Attachments
nwgdata.xls
the file where you have the data
(26.5 KiB) Downloaded 114 times
fin_bayes1.mod
this
(3.13 KiB) Downloaded 84 times
hjawara
 
Posts: 5
Joined: Thu May 30, 2013 12:04 pm

Re: Bayesian Estimation \

Postby jpfeifer » Thu May 30, 2013 3:10 pm

------------
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: Bayesian Estimation \

Postby hjawara » Thu May 30, 2013 3:29 pm

Thanks Jpfeifer! I will check them and I hope I will find something useful :)
hjawara
 
Posts: 5
Joined: Thu May 30, 2013 12:04 pm

Re: Bayesian Estimation \

Postby hjawara » Thu May 30, 2013 8:22 pm

I have tried all the possible suggestion of the above forums but still can't resolve the problem. With the mode_compute =6 cmd gives me the following error massage:

MH: Parameter mh_init_scale is equal to 0.600000.
MH: Enter a new value...
??? Error using ==> mtimes
Inner matrix dimensions must agree.

Error in ==> metropolis_hastings_initialization at 110
candidate = rand_multivariate_normal( transpose(xparam1), d *
options_.mh_init_scale, npar);

Error in ==> random_walk_metropolis_hastings at 69
[ ix2, ilogpo2, ModelName, MhDirectoryName, fblck, fline, npar, nblck, nruns,
NewFile, MAX_nruns, d ] = ...

Error in ==> dynare_estimation_1 at 931
feval(options_.posterior_sampling_method,objective_function,options_.proposal_distribution,xparam1,invhess,bounds,dataset_,options_,M_,estim_params_,bayestopt_,oo_);

Error in ==> dynare_estimation at 70
dynare_estimation_1(var_list,dname);

Error in ==> fin_bayes1 at 281
dynare_estimation(var_list_);

Error in ==> dynare at 120
evalin('base',fname) ;
hjawara
 
Posts: 5
Joined: Thu May 30, 2013 12:04 pm

Re: Bayesian Estimation \

Postby jpfeifer » Fri May 31, 2013 5:48 am

Please post the most current version of the mod- and datafile.
------------
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: Bayesian Estimation \

Postby hjawara » Fri May 31, 2013 10:02 am

Thanks JPfeifer! Attached are the updated files. I added a new file ,data, which contains the original series that have been hpfiltered in the other dataset, nwgdata and this is use for the bayesian estimation.
Attachments
data.xls
(26 KiB) Downloaded 111 times
nwgdata.xls
(26.5 KiB) Downloaded 133 times
fin_bayes1.mod
(3.21 KiB) Downloaded 91 times
hjawara
 
Posts: 5
Joined: Thu May 30, 2013 12:04 pm

Re: Bayesian Estimation \

Postby jpfeifer » Mon Jun 03, 2013 6:34 pm

There is a lot awry.

1. 32 observations is not sufficient. [Update: see the clarification here http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=4723&start=0]
2. Hp filtering removes the mean, but your observable variable is not mean 0
3. Your model and your data are/were not in logs. Thus, they are not percentages but levels. This means that the scaling matters.
4. Two-sided HP-filtering is non-causal and strongly discouraged for Bayesian estimation

Points two and three essentially mean that you need a correctly specified observation equation.
------------
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: Bayesian Estimation \

Postby hjawara » Tue Jun 04, 2013 10:30 pm

Thanks once more JPfeifer!! I have found a better way of detrending the data and now the estimation is running with 35 observations
Attachments
fin_bayes1.mod
(3.46 KiB) Downloaded 111 times
hjawara
 
Posts: 5
Joined: Thu May 30, 2013 12:04 pm


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 7 guests