Page 1 of 1
posterior kernel optimization problem
Posted:
Mon Mar 16, 2015 6:09 pm
by mharding
Hi,
I am trying to replicate the estimation of Christensen & Dib (2008) Review of Economic Dynamics using bayesian methods. In other posts regarding this problem, I have read that I should change the initialization of parameters. I have tried several settings, and the problem persists (in this version of the code I use the empirical estimates of the authors). I use a one-sided HP-filter to detrend the data.
Any suggestion on how to set proper initial values or how to solve this issue in general is greatly appreciated.
Re: posterior kernel optimization problem
Posted:
Wed Mar 18, 2015 8:29 pm
by jpfeifer
Before continuing, please take a look at "Remark 4 (Parameter dependence and the use of model-local variables)" in Pfeifer(2013): "A Guide to Specifying Observation Equations for the Estimation of DSGE Models"
https://sites.google.com/site/pfeiferecon/Pfeifer_2013_Observation_Equations.pdf.
- Code: Select all
R_ss=pi_ss/betap;
f_ss=(S*R_ss)/pi_ss;
z_ss=f_ss+deltap-1;
lambda_c=(1+b_ss*(pi_ss/(pi_ss-betap))^(gammap-1))^(-1);
lambda_m=lambda_c*b_ss*(pi_ss/(pi_ss-betap))^(gammap);
k__y=alphap*(xi_ss/z_ss);
c__y=1-deltap*k__y;
w_h_lambda=((1-alphap)*lambda_c*xi_ss)/c__y;
h_ss=w_h_lambda/(etap+w_h_lambda);
i__y=1-c__y;
must not be defined before the model. It needs to be updated in every iteration.
Re: posterior kernel optimization problem
Posted:
Fri Mar 20, 2015 8:03 pm
by mharding
Dear Johannes,
thanks a lot for the reply. I modified the mod file but still get the hessian problem. Given that the model likelihood is probably a rather complex function, I got the suggestion of using the annealing optimization tool from matlab to search the global maximum of the likelihood (in the .m files attached there is an example with a simple function).
Do you know how could I implement a similar procedure for the likelihood function of the model, given the Dynare output obtained when running the code? Any other suggestion is very welcome!
Thanks again.
Re: posterior kernel optimization problem
Posted:
Mon Mar 23, 2015 4:22 pm
by jpfeifer
Have you tried
- Code: Select all
mode_compute=6
which is similar to the simulated annealing? I will prepare an example for external minimizers in due course, but this will take some time.
Re: posterior kernel optimization problem
Posted:
Tue Mar 24, 2015 10:52 am
by mharding
I tried. Actually I used mode_compute=4 and then mode_compute=6 using the load_mh_file command. I still get some weird results.
In particular I would like to ask you about the interpretation of the mode_check plots (plots attached). For the two parameters that have a mode practically equal to zero, psip and varrho_y, the graphs show that the vertical line is clearly not intersecting a maximum or minimum. How to interpret this and what might be the associated problem? Also, how to interpret the red dots and nearly flat areas in the second group of plots (second page)?
Finally, after running mode_compute=6 I still get the following warning:
"MODE CHECK
Fval obtained by the minimization routine: -2251.012800
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 2.220446e-16.
> In lyapunov_symm at 145
In dsge_likelihood at 374
In mode_check at 141
In dynare_estimation_1 at 701
In dynare_estimation at 89
In CD08_estimation_pf at 330
In dynare at 180
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 2.220446e-16.
> In lyapunov_symm at 145
In dsge_likelihood at 374
In mode_check at 141
In dynare_estimation_1 at 701
In dynare_estimation at 89
In CD08_estimation_pf at 330
In dynare at 180
Warning: Matrix is singular to working precision.
> In lyapunov_symm at 145
In dsge_likelihood at 374
In mode_check at 141
In dynare_estimation_1 at 701
In dynare_estimation at 89
In CD08_estimation_pf at 330
In dynare at 180
Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate. RCOND = NaN.
> In kalman_filter at 182
In dsge_likelihood at 646
In mode_check at 141
In dynare_estimation_1 at 701
In dynare_estimation at 89
In CD08_estimation_pf at 330
In dynare at 180"
Should I worry about this?
Thank you!
Re: posterior kernel optimization problem
Posted:
Mon Apr 06, 2015 10:25 am
by jpfeifer
1. Yes, you should worry as this is problematic. You are clearly not at an interior mode. Reason can be too strict priors or wrong estimation equations (or general mistakes in setting up the model)
2. For the interpretation of the graphs, see Pfeifer (2014): An Introduction to Graphs in Dynare at
https://sites.google.com/site/pfeiferecon/dynare3. Regarding other optimizers, including user-defined ones, we are working on it, see
https://github.com/DynareTeam/dynare/pull/873
Re: posterior kernel optimization problem
Posted:
Mon Apr 13, 2015 9:18 pm
by mharding
Dear Johannes, thanks a lot for the comments!