Bayesian Estimation \

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
nwgdata.xls (26.5 KB)
fin_bayes1.mod (3.13 KB)

Search the forum, there are dozens of posts. Start here:
[? Error using ==> chol Matrix must be positive definite)
[Problems with Maximum Likelihood)
[Error: chol: input matrix must be positive definite)

Thanks Jpfeifer! I will check them and I hope I will find something useful :slight_smile:

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) ;

Please post the most current version of the mod- and datafile.

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.
data.xls (26 KB)
nwgdata.xls (26.5 KB)
fin_bayes1.mod (3.21 KB)

There is a lot awry.

  1. 32 observations is not sufficient. [Update: see the clarification here [url]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.

Thanks once more JPfeifer!! I have found a better way of detrending the data and now the estimation is running with 35 observations
fin_bayes1.mod (3.46 KB)