Dear Dynare helpers,

I have been debugging this large-scale DSGE model for two days, but the job is not fruitful yet. I am wondering if this error message could provide me some hint?

I have used model diagnostic command but it says no obvious error is detected.

It seems to me the main problem is that the estimated capital share is constantly pushed to the lower bound of priors. I think there is probably a problem with the model itself. Would you think the problem is most likely in one of the equations or the steady state relationships with the parameter? Or more loosely related, the F.O.C’s for investment and capital, etc?

And the parameter risk aversion is low compared to commonly calibrated values, although within its bound.

I have also attached my code here, but you don’t really have to provide me an exact answer, because it seems to be a model-related issue, and I understand that this is not your responsibility. I am just wondering if somehow I can narrow my scope of debugging, or if there are problems which I might have overlooked. If you can offer some debugging skills it would have been better.

I have a closed economy version which works well (it is almost the same as Smets Wouters 07), but it seems not easy to reduce my model gradually to that model, because the relative prices connect everything together.

Posterior_Generation.mod (35.5 KB)

data.mat (57.5 KB)

Posterior_Generation_mode.mat (23.1 KB)

POSTERIOR KERNEL OPTIMIZATION PROBLEM!

(minus) the hessian matrix at the “mode” is not positive definite!

=> posterior variance of the estimated parameters are not positive.

You should try to change the initial values of the parameters using

the estimated_params_init block, or use another optimization routine.

The following parameters are at the prior bound: calfa

Some potential solutions are:

- Check your model for mistakes.
- Check whether model and data are consistent (correct observation equation).
- Shut off prior_trunc.
- Change the optimization bounds.
- Use a different mode_compute like 6 or 9.
- Check whether the parameters estimated are identified.
- Check prior shape (e.g. Inf density at bound(s)).
- Increase the informativeness of the prior.

Warning: The results below are most likely wrong!

In dynare_estimation_1 (line 316)

In dynare_estimation (line 105)

In Posterior_Generation (line 1372)

In dynare (line 235)

MODE CHECK

Fval obtained by the minimization routine (minus the posterior/likelihood)): 749.390684

Most negative variance -1489.654462 for parameter 2 (eb = 0.173789)

Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate. RCOND = NaN.

In dynare_estimation_1 (line 339)

In dynare_estimation (line 105)

In Posterior_Generation (line 1372)

In dynare (line 235)

Error using chol

Matrix must be positive definite with real diagonal.

Error in posterior_sampler_initialization (line 84)

d = chol(vv);

Error in posterior_sampler (line 60)

posterior_sampler_initialization(TargetFun, xparam1, vv, mh_bounds,dataset_,dataset_info,options_,M_,estim_params_,bayestopt_,oo_);

Error in dynare_estimation_1 (line 448)

posterior_sampler(objective_function,posterior_sampler_options.proposal_distribution,xparam1,posterior_sampler_options,bounds,dataset_,dataset_info,options_,M_,estim_params_,bayestopt_,oo_);

Error in dynare_estimation (line 105)

dynare_estimation_1(var_list,dname);

Error in Posterior_Generation (line 1341)

oo_recursive_=dynare_estimation(var_list_);

Error in dynare (line 235)

evalin(‘base’,fname) ;

Best

Jing