posterior kernel optimization problem

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

posterior kernel optimization problem

Postby mharding » Mon Mar 16, 2015 6:09 pm

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.
Attachments
CD08_estimation.mod
(5.34 KiB) Downloaded 64 times
CD08_usdata_filt.xls
(33.5 KiB) Downloaded 68 times
mharding
 
Posts: 18
Joined: Mon Mar 16, 2015 2:18 pm

Re: posterior kernel optimization problem

Postby jpfeifer » Wed Mar 18, 2015 8:29 pm

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: posterior kernel optimization problem

Postby mharding » Fri Mar 20, 2015 8:03 pm

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.
Attachments
CD08_usdata_filt.xls
(33.5 KiB) Downloaded 61 times
CD08_estimation_pf.mod
(5.31 KiB) Downloaded 57 times
simple_objective.m
simple objective function to be solved with annealing
(110 Bytes) Downloaded 48 times
annealing.m
(478 Bytes) Downloaded 48 times
mharding
 
Posts: 18
Joined: Mon Mar 16, 2015 2:18 pm

Re: posterior kernel optimization problem

Postby jpfeifer » Mon Mar 23, 2015 4:22 pm

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: posterior kernel optimization problem

Postby mharding » Tue Mar 24, 2015 10:52 am

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!
Attachments
CD08_estimation_pf_CheckPlots1-2.pdf
(21.03 KiB) Downloaded 283 times
mharding
 
Posts: 18
Joined: Mon Mar 16, 2015 2:18 pm

Re: posterior kernel optimization problem

Postby jpfeifer » Mon Apr 06, 2015 10:25 am

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/dynare
3. Regarding other optimizers, including user-defined ones, we are working on it, see https://github.com/DynareTeam/dynare/pull/873
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: posterior kernel optimization problem

Postby mharding » Mon Apr 13, 2015 9:18 pm

Dear Johannes, thanks a lot for the comments!
mharding
 
Posts: 18
Joined: Mon Mar 16, 2015 2:18 pm


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 4 guests