Estimation 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.

Estimation problem

Postby matte » Fri Aug 27, 2010 7:23 am

Dear,

I try to do a robustness check when estimating Taylor rule with a reaction to 1)current inflation, 2)expected inflation. Therefore, the Taylor in Dynare code look
1)Rhat = (1-rR)*rq*qinf + (1-rR)*rpi*pihat+ry*(1-rR)*Yhat+rR*Rhat(-1)+eRhat; for current inflation
2)Rhat = (1-rR)*rq*qinf + (1-rR)*rpi*pihat(+1)+ry*(1-rR)*Yhat+rR*Rhat(-1)+eRhat; for expected inflation

Although I get estimated the model with a reaction to current inflation, I get an error when estimating the model with a reaction to expected inflation. Here is the error message:


??? Error using ==> chol
Matrix must be positive definite.

Error in ==> metropolis_hastings_initialization at 52
d = chol(vv);

Error in ==> random_walk_metropolis_hastings at 43
[ ix2, ilogpo2, ModelName, MhDirectoryName, fblck, fline, npar, nblck, nruns, NewFile, MAX_nruns, d ] = ...

Error in ==> dynare_estimation_1 at 1057
feval(options_.posterior_sampling_method,'DsgeLikelihood',options_.proposal_distribution,xparam1,invhess,bounds,gend,data,...

Error in ==> dynare_estimation at 62
dynare_estimation_1(var_list,varargin{:});

Error in ==> A_new at 311
dynare_estimation(var_list_);

Error in ==> dynare at 132
evalin('base',fname) ;



Could you help me on this, please?
I enclose my Dynare code and data used for the estimation.

Many many thanks in advance,
M
Attachments
A_new.mod
code
(4.29 KiB) Downloaded 121 times
data_new.m
data
(3.49 KiB) Downloaded 126 times
matte
 
Posts: 15
Joined: Wed Jul 28, 2010 7:06 am

Re: Estimation problem

Postby jpfeifer » Fri Aug 27, 2010 7:58 am

Try mode_compute=6. Seach the forum for it and you will find many answers.
------------
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: Estimation problem

Postby matte » Fri Aug 27, 2010 8:51 am

Could you tell, pls, where in the code I have to make a change mode_compute=6?
matte
 
Posts: 15
Joined: Wed Jul 28, 2010 7:06 am

Re: Estimation problem

Postby AssiaEzzeroug » Fri Aug 27, 2010 9:25 am

Hi,

this message error means that the mode optimization hasnt converged and dynare can't run MH from such a bad mode. I tried with another solver by adding in the estimation command the option "mode_compute=4" and now it works.
Plz see the attached file.

Best
Attachments
A_new.mod
(4.3 KiB) Downloaded 133 times
AssiaEzzeroug
 
Posts: 83
Joined: Tue Nov 24, 2009 3:48 pm

Re: Estimation problem

Postby jpfeifer » Fri Aug 27, 2010 9:39 am

Sorry, but mode_compute=4 is the estimation default. So that should be what you have done anyway. Due to the random element in the csminwel, it sometimes works, but sometimes doesn't. Usually, the alternative is mode_compute=6 (http://www.dynare.org/DynareWiki/MonteCarloOptimization).
------------
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: Estimation problem

Postby matte » Fri Aug 27, 2010 10:22 am

Hi!
the code work only with
Rhat = (1-rR)*rq*qinf + (1-rR)*rpi*pihat+ry*(1-rR)*Yhat+rR*Rhat(-1)+eRhat

and not with:
Rhat = (1-rR)*rq*qinf + (1-rR)*rpi*pihat(+1)+ry*(1-rR)*Yhat+rR*Rhat(-1)+eRhat; for expected inflation.

I attach now the code which generates error.
I tried to write mode_compute=6 but it took 30 mins to do MH and still no results, so I aborted the process.

Could you help, please, I am desperate....
Attachments
data_new.m
data
(3.49 KiB) Downloaded 118 times
A_new.mod
code
(4.29 KiB) Downloaded 128 times
matte
 
Posts: 15
Joined: Wed Jul 28, 2010 7:06 am

Re: Estimation problem

Postby AssiaEzzeroug » Fri Aug 27, 2010 10:29 am

ok thought it was 0 but thats right by default it is 4. Anyway I can send you the mode I got if you wanna (seems that mat.* files cant be attached here) that may help for the initialization of the optimization procedure. In that case you'll need to load it using the option "mode_file=A_new_mode"

Hope this helps.
AssiaEzzeroug
 
Posts: 83
Joined: Tue Nov 24, 2009 3:48 pm

Re: Estimation problem

Postby matte » Fri Aug 27, 2010 10:38 am

is it with pihat or pihat(+1)?
matte
 
Posts: 15
Joined: Wed Jul 28, 2010 7:06 am

Re: Estimation problem

Postby AssiaEzzeroug » Fri Aug 27, 2010 10:47 am

my previous reply relates to the first mod.* file you posted. Regarding the second one, I recommend you to change the initial values of the parameters to be estimated by adding a block "estimated_params_init;" Note that they are initialized at their prior mean by default.

best
AssiaEzzeroug
 
Posts: 83
Joined: Tue Nov 24, 2009 3:48 pm

Re: Estimation problem

Postby jpfeifer » Fri Aug 27, 2010 10:51 am

Just FYI: using mode_compute=6 almost always gets you a positive definite inverse Hessian, so the Cholesky decomposition will not fail (you won't get "Matrix must be positive definite."). However, the huge drawback is that for larger models it sometimes takes several hours to complete. You can change the parameters mentioned in the Wiki to speed it up, but you will buy speed with less accuracy.
As AssiaEzzeroug says, changing the initial parameters might help, but my experience for larger models is that most of the time you will still get the same error message with mode_compute=4 (the default).
------------
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: Estimation problem

Postby matte » Fri Aug 27, 2010 10:53 am

but if I change parameters, there will not be any robustness check... My aim is to check the model with the same parameters but with two types of rule: expected inflation and current inflation.
matte
 
Posts: 15
Joined: Wed Jul 28, 2010 7:06 am

Re: Estimation problem

Postby matte » Fri Aug 27, 2010 2:22 pm

I tried mode_compute=6 but the estimators are quite different....
matte
 
Posts: 15
Joined: Wed Jul 28, 2010 7:06 am


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 5 guests