Page 1 of 1
Bayesian Estimation \

Posted:
Thu May 30, 2013 12:32 pm
by hjawara
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
Re: Bayesian Estimation \

Posted:
Thu May 30, 2013 3:10 pm
by jpfeifer
Re: Bayesian Estimation \

Posted:
Thu May 30, 2013 3:29 pm
by hjawara
Thanks Jpfeifer! I will check them and I hope I will find something useful

Re: Bayesian Estimation \

Posted:
Thu May 30, 2013 8:22 pm
by hjawara
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) ;
Re: Bayesian Estimation \

Posted:
Fri May 31, 2013 5:48 am
by jpfeifer
Please post the most current version of the mod- and datafile.
Re: Bayesian Estimation \

Posted:
Fri May 31, 2013 10:02 am
by hjawara
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.
Re: Bayesian Estimation \

Posted:
Mon Jun 03, 2013 6:34 pm
by jpfeifer
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.
Re: Bayesian Estimation \

Posted:
Tue Jun 04, 2013 10:30 pm
by hjawara
Thanks once more JPfeifer!! I have found a better way of detrending the data and now the estimation is running with 35 observations