Error in estimation using dynare 4.2.0

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.

Error in estimation using dynare 4.2.0

Postby iloveshjtl » Tue Mar 15, 2011 6:51 am

Dear all.

I am facing a problem in solving Open Eocnomy New Keyesian DSGE model.
While I tried to solve the model, dynare gave me back the following message.

This version of Dynare cannot estimate non linearized models!
Set "order" equal to 1.

??? Reference to non-existent field 'y'.

Error in ==> read_variables at 63
dyn_tmp_01 = s.(deblank(var_names_01(dyn_i_01,:)));

Error in ==> dynare_estimation_1 at 269
rawdata = read_variables(options_.datafile,options_.varobs,[],options_.xls_sheet,options_.xls_range);

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

Error in ==> newzealand at 254
dynare_estimation(var_list_);


Please give me a hint about the source of my trouble. Here attached is the mod file and the data file.
Thanks in advance!!
Attachments
newzealand.xls
(24.5 KiB) Downloaded 171 times
newzealand.mod
(2.67 KiB) Downloaded 168 times
iloveshjtl
 
Posts: 10
Joined: Tue Mar 15, 2011 6:34 am

Re: Error in estimation using dynare 4.2.0

Postby jpfeifer » Tue Mar 15, 2011 8:50 am

Hi,
you can solve models in higher order, i.e. use
Code: Select all
stoch_simul(order=2);

but you cannot estimate them in higher order, i.e.
Code: Select all
estimation(order=2);
------------
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: Error in estimation using dynare 4.2.0

Postby iloveshjtl » Tue Mar 15, 2011 11:17 am

Thank you for answering.

I tried to correct the problem as you told me (stoch_simul(order=2)),
but another problem is occured.

??? 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 58
[ ix2, ilogpo2, ModelName, MhDirectoryName, fblck, fline, npar, nblck, nruns, NewFile, MAX_nruns, d ] = ...

Error in ==> dynare_estimation_1 at 1106
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 ==> newzealand at 254
dynare_estimation(var_list_);

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

What can I do at this time? I attach the .mod file. Is it wrong?
Help me please
Attachments
newzealand.mod
(2.67 KiB) Downloaded 148 times
iloveshjtl
 
Posts: 10
Joined: Tue Mar 15, 2011 6:34 am

Re: Error in estimation using dynare 4.2.0

Postby rzulfadin » Tue Mar 15, 2011 12:31 pm

Hi,

It works fine using Octave 3.2.4 and Dynare 4.1.3. Attached the files I used. Please note that I made few changes. I changed 'pi' to 'pie', decrease mh_replic from 20000 to 2000. I also use simulated data because when I used your data set it produced error saying that "the data are perfectly correlated".

I used order=2 for simulation and order=1 for estimation.

The following are the posterior maximization and estimation results.

Improvement on iteration 100 = 0.000000046
improvement < crit termination
Objective function at mode: 870.754938
Objective function at mode: 870.754938

RESULTS FROM POSTERIOR MAXIMIZATION
parameters
prior mean mode s.d. t-stat prior pstdev

h 0.700 0.9069 0.0108 84.0683 beta 0.2000
sigma 1.000 0.4526 0.0678 6.6741 norm 0.2500
phi 1.000 1.0689 0.2767 3.8635 gamm 0.3000
eta 1.000 0.8539 0.0309 27.5995 gamm 0.3000
thetah 0.500 0.7018 0.0329 21.3333 beta 0.2500
thetaf 0.500 0.6984 0.0313 22.3170 beta 0.2500
rhoa 0.500 0.9420 0.0216 43.6672 beta 0.2000
phi1 1.500 1.4939 0.0710 21.0291 gamm 0.2500
phi2 0.250 0.3717 0.0409 9.0890 gamm 0.1000
rhor 0.500 0.7189 0.0129 55.8809 beta 0.2000
lam1 0.500 0.7453 0.0638 11.6896 beta 0.2000
rhorstar 0.500 0.8101 0.0194 41.8591 beta 0.2000
standard deviation of shocks
prior mean mode s.d. t-stat prior pstdev

eps_s 2.000 9.8020 0.9029 10.8562 invg Inf
eps_q 2.000 5.2866 0.4938 10.7053 invg Inf
eps_pih 2.000 1.5806 0.1577 10.0225 invg Inf
eps_pif 2.000 3.7853 0.3553 10.6526 invg Inf
eps_r 2.000 0.8253 0.0803 10.2736 invg Inf
eps_a 2.000 1.3220 0.2857 4.6266 invg Inf
eps_ystar 2.000 0.6476 0.0600 10.7929 invg Inf
eps_rstar 2.000 0.6364 0.0585 10.8829 invg Inf

Log data density [Laplace approximation] is -911.142917.


ESTIMATION RESULTS

Log data density is -915.088177.

parameters
prior mean post. mean conf. interval prior pstdev

h 0.700 0.9049 0.8893 0.9219 beta 0.2000
sigma 1.000 0.4570 0.3533 0.5526 norm 0.2500
phi 1.000 1.1128 0.6949 1.5582 gamm 0.3000
eta 1.000 0.8623 0.8097 0.9160 gamm 0.3000
thetah 0.500 0.7025 0.6524 0.7500 beta 0.2500
thetaf 0.500 0.6921 0.6375 0.7490 beta 0.2500
rhoa 0.500 0.9397 0.9082 0.9732 beta 0.2000
phi1 1.500 1.5099 1.3881 1.6323 gamm 0.2500
phi2 0.250 0.3810 0.3063 0.4479 gamm 0.1000
rhor 0.500 0.7202 0.7003 0.7465 beta 0.2000
lam1 0.500 0.7216 0.6147 0.8202 beta 0.2000
rhorstar 0.500 0.8112 0.7806 0.8421 beta 0.2000

standard deviation of shocks
prior mean post. mean conf. interval prior pstdev

eps_s 2.000 10.0468 8.6075 11.7740 invg Inf
eps_q 2.000 5.4639 4.5953 6.1770 invg Inf
eps_pih 2.000 1.6447 1.4135 1.8738 invg Inf
eps_pif 2.000 3.9998 3.3064 4.7826 invg Inf
eps_r 2.000 0.8577 0.7228 1.0457 invg Inf
eps_a 2.000 1.4441 0.9427 2.0262 invg Inf
eps_ystar 2.000 0.6607 0.5587 0.7431 invg Inf
eps_rstar 2.000 0.6472 0.5597 0.7400 invg Inf
Total computing time : 0h11m59s
octave-3.2.4.exe:12>
Attachments
artificialnz.m
(563.57 KiB) Downloaded 249 times
newzealand.mod
(2.74 KiB) Downloaded 204 times
rzulfadin
 
Posts: 5
Joined: Tue Feb 01, 2011 11:34 am

Re: Error in estimation using dynare 4.2.0

Postby iloveshjtl » Wed Mar 16, 2011 8:06 am

Thank you for answering!!

But I have another question about your answer. ( I'm new in dynare. :cry: )
What's the meaning of the 'simulated data' ? Can I make this ? How?
And, when I want to estimate DSGE model in particular area(ex. Newzealand, South korea etc), can I use simulated data?
( I guess that simulated data is different from actual data, so I may not use simulated data )

Plus, I tried to play the simulated data and mod file as you attached it.
But dynare gives warnings like below.

Warning: File 'nz/Output' not found.
> In CheckPath at 42
In dynare_estimation_1 at 901
In dynare_estimation at 62
In nz at 257
In dynare at 132
Warning: File 'nz/metropolis' not found.
> In CheckPath at 42
In metropolis_hastings_initialization at 46
In random_walk_metropolis_hastings at 58
In dynare_estimation_1 at 1106
In dynare_estimation at 62
In nz at 257
In dynare at 132

What's the meaning? Can I ignore that?

Thanks a lot!!
iloveshjtl
 
Posts: 10
Joined: Tue Mar 15, 2011 6:34 am

Re: Error in estimation using dynare 4.2.0

Postby rzulfadin » Wed Mar 16, 2011 8:19 am

Hi,

In fact I am also new in Dynare. :D
Simulated data comes from simulation (stoch_simul) command. Of course it is not real data. You can produce simulated data by putting

Code: Select all
datatomfile('artificialnz',[]);


after stoch_simul command. It will create simulated data named artificialnz.m. Of course you have to use real data if you want to estimate "real" parameters.

I am not sure about the warning messages. Maybe others can answer it. My apologize.

RZ
rzulfadin
 
Posts: 5
Joined: Tue Feb 01, 2011 11:34 am

Re: Error in estimation using dynare 4.2.0

Postby jpfeifer » Wed Mar 16, 2011 8:28 am

You can ignore the warnings. They just say that the respective folder does not exist yet on the harddrive and will now be created.
------------
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: Error in estimation using dynare 4.2.0

Postby iloveshjtl » Wed Mar 16, 2011 8:55 am

Thanks a lot !!
I received much help!! :D
iloveshjtl
 
Posts: 10
Joined: Tue Mar 15, 2011 6:34 am


Return to Dynare help

Who is online

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