Bayesian estimation problem

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.
Warning: The results below are most likely wrong!

In dynare_estimation_1 at 694
In dynare_estimation at 89
In dsge_esti at 568
In dynare at 180

RESULTS FROM POSTERIOR ESTIMATION
parameters
prior mean mode s.d. prior pstdev

gamma_l 0.500 0.6794 0.0000 beta 0.1000
sigma 0.800 0.9798 0.0136 beta 0.1000
upsilon 0.500 0.5236 0.0000 beta 0.1000
alpha 0.400 0.6672 0.0000 beta 0.1000
chi_m 1.000 0.9751 0.0000 gamm 0.1000
phi 0.500 0.5545 0.0000 beta 0.1000
iota_d 0.500 0.5010 0.0000 beta 0.1000
iota_f 0.500 0.5503 0.0000 beta 0.1000
el 0.500 0.4682 0.0000 beta 0.1000
gamma 0.500 0.4909 0.0000 beta 0.1000
rho_rr 0.500 0.4420 0.0000 beta 0.1000
rho_r 0.500 0.9492 0.0052 beta 0.1000
lambda_y 1.500 1.4307 0.0000 gamm 0.1000
lambda_pi 0.500 0.4584 0.0884 gamm 0.1000
lambda_m 0.500 0.4804 0.0000 gamm 0.1000
lambda_q 0.500 0.2747 0.0000 gamm 0.1000
rho_y 0.500 0.0582 0.0000 beta 0.1000
rho_w 0.500 0.4091 0.0000 beta 0.1000
rho_rf 0.500 0.4846 0.1054 beta 0.1000
rho_ex 0.500 0.4714 0.1057 beta 0.1000
rho_a 0.500 0.4621 0.0000 beta 0.1000
rho_g 0.500 0.3133 0.0387 beta 0.1000

standard deviation of shocks
prior mean mode s.d. prior pstdev

mu_r 0.500 0.7280 0.0000 invg 0.1000
mu_rf 0.500 0.2119 0.0173 invg 0.1000
mu_ex 0.500 0.2330 0.0206 invg 0.1000
mu_q 0.500 0.3960 0.0000 invg 0.1000
mu_w 0.500 0.3286 0.0000 invg 0.1000
mu_a 0.500 0.2395 0.0217 invg 0.1000
mu_g 0.500 0.5089 0.0000 invg 0.1000

Log data density [Laplace approximation] is 140.455307.

Error using chol
Matrix must be positive definite.

Error in metropolis_hastings_initialization (line 68)
d = chol(vv);

Error in random_walk_metropolis_hastings (line 62)
ix2, ilogpo2, ModelName, MetropolisFolder, fblck, fline, npar, nblck, nruns,
NewFile, MAX_nruns, d ] = …

Error in dynare_estimation_1 (line 782)
feval(options_.posterior_sampling_method,objective_function,options_.proposal_distribution,xparam1,invhess,bounds,dataset_,options_,M_,estim_params_,bayestopt_,oo_);

Error in dynare_estimation (line 89)
dynare_estimation_1(var_list,dname);

Error in dsge_esti (line 568)
dynare_estimation(var_list_);

Error in dynare (line 180)
evalin(‘base’,fname) ;
obs_data.m (4.75 KB)
dsge_esti.mod (3.81 KB)

First and foremost, your model does not handle parameter dependence correctly. See Pfeifer(2013): “A Guide to Specifying Observation Equations for the Estimation of DSGE Models”

Hello, jpfeifer

Thanks to you for your help. Now I meet another problem as follow.

Improvement on iteration 13 = 0.000000000
improvement < crit termination
Objective function at mode: 806.127685

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.
Warning: The results below are most likely wrong!

In dynare_estimation_1 at 694
In dynare_estimation at 89
In dsge_esti at 549
In dynare at 180

The model equations are linear: I’d like to know how to set the steady state values of these parameters: (R_R R_F MM T_M NN D_M KK I_K D_I RR_R PI_PI PI_F QQ M_RR Y_R PI_R Q_R G_M C_Y I_Y G_Y EX_Y IM_Y) . as the model equations are linear, the initial values of all endogenous variables are zero. But the parameters like R_R is not endogenous variable.

Thanks to everyone.

model(linear);
(gamma_l*(1-sigma)-1)c=lambda-(1- gamma_l)(1-sigma)m;
beta_PI
(m-c) =(beta_PI)(lambda(+1)-pi(+1)-lambda);
upsilon
n=lambda+w;
(beta_PI*(1+R_R)-1)d= beta_PI(1+R_R)(lambda(+1)-pi(+1)-lambda)+beta_PIR_Rr;
(beta_PI
(1+R_F)-1)(s-f)= beta_PI(1+R_F)(lambda(+1)+s(+1)-s-pi(+1)-lambda)+beta_PIR_Fr;
//C_M
c=WN_M*(w+n)+D_M*((1+R_R)d(-1)+R_Rr(-1)-d)+(iota_dD_M/iota_f)((1+R_F)(s+f(-1))+R_Frf(-1)-(s+f))-((MM/2)(iota_d+iota_d^2/iota_f)D_M^2)z-MM(m-m(-1))-T_Mt;
C_M
c=(NN^( upsilon+1)/((gamma_lMM^(-sigma)C_M^(gamma_l(1-sigma)-1))MM))(w+n)+D_M((1+R_R)d(-1)+R_Rr(-1)-d)+(iota_dD_M/iota_f)((1+R_F)(s+f(-1))+R_Frf(-1)-(s+f))-((MM/2)(iota_d+iota_d^2/iota_f)D_M^2)z-MM(m-m(-1))-T_Mt;
((MM/2)
(iota_d+iota_d^2/iota_f)D_M^2)z=iota_dMM(D_M^2)+iota_fMM((iota_dD_M/iota_f))^2(s+f);
y=alphak+(1-alpha)(a+n);
rr=xi+y-k;
w=xi+y-n;
KKk(+1)=(I_K-el(I_K-delta))(i-k)+(1-delta)KKk;
//KK
k=(I_K-el*(I_K-delta))(i-k(-1))+(1-delta)KKk(-1);
i=(1-eta_zeta)D_Id+e_w;
pih=(1-phi)
(1-betaphi)xi/phi+betapih(+1);
pif=(1-phi)
(1-betaphi)xi/phi+betapif(+1);
pi=gamma
pih+(1-gamma)pif;
R_R
r=(1-gamma_l)(RR_Rrr+PI_PIpi)+gamma_l(R_Frf-PI_Fpif+PI_PIpi(+1)+QQq(+1)-QQq)+e_q;
rr=rho_rr
rr(-1)+(1-rho_rr)chi_mM_RR*(m-m(-1));
r=rho_rr(-1)+(1-rho_r)(lambda_yY_Ry+lambda_piPI_Rpi+lambda_mPI_Rnu+lambda_qQ_Rq)+mu_r;
nu=m+pi-m(-1);
T_Mt=G_Mg-m+(m(-1)-pi)/PI_PI;
y=C_Yc+I_Yi+G_Yg+EX_Yex-IM_Yim;
im=rho_y+e_q;
e_q=rho_q
e_q(-1)+mu_q;
e_w=rho_we_w(-1)+mu_w;
rf=rho_rf
rf(-1)+mu_rf;
ex=rho_exrf(-1)+mu_ex;
a=rho_a
a(-1)+mu_a;
g=rho_g*g(-1)+mu_g;

end;

You need to compute these objects from the steady state of your nonlinear model. There is no way around this.