stoch_simul works but estimation does not

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.

stoch_simul works but estimation does not

Postby shuixing » Thu Dec 24, 2015 11:53 am

hi

while I use stoch_simul for a fully calibrated model the model seems to work well,

but if I use observations to estimae some parameters then a problem always exists:

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 458
In dynare_estimation at 70
In lcmr at 304
In dynare at 120

MODE CHECK

Fval obtained by the minimization routine: -655.668810

Most negative variance -284255.670560 for parameter 1 (e_epsil = 0.006506)
Warning: Matrix is close to singular or badly scaled.
Results may be inaccurate. RCOND = 1.757306e-016.
> In dynare_estimation_1 at 473
In dynare_estimation at 70
In lcmr at 304
In dynare at 120

what seems to be the problem?
shuixing
 
Posts: 38
Joined: Sun Apr 13, 2014 2:08 pm

Re: stoch_simul works but estimation does not

Postby jpfeifer » Sat Dec 26, 2015 10:16 am

Please search the forum on this. A first indication can derived from the mode-check plots.
------------
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: stoch_simul works but estimation does not

Postby shuixing » Tue Dec 29, 2015 11:42 am

jpfeifer wrote:Please search the forum on this. A first indication can derived from the mode-check plots.

thanks professor jpfeifer, a few parameters' mode chek plot do have red dots within some range, so should I impose parameters bound restriction?
shuixing
 
Posts: 38
Joined: Sun Apr 13, 2014 2:08 pm

Re: stoch_simul works but estimation does not

Postby jpfeifer » Tue Dec 29, 2015 3:08 pm

Red dots are not an issue. The question is whether the modes are at the peaks of the posterior and whether there are vertical likelihood kernels.
------------
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: stoch_simul works but estimation does not

Postby shuixing » Sat Jan 02, 2016 4:54 am

jpfeifer wrote:Red dots are not an issue. The question is whether the modes are at the peaks of the posterior and whether there are vertical likelihood kernels.


thanks dear professor jpfeifer, you are always so helpful, just one more question, the dynare manul does not provide enough details to deal with ouput of dynare ,for example where is the smoothed shock or variable saved and how to feed some smoothed shocks into simulation while shut off other shocks, so where can I find some learning materials for a further study about things like these, thanks jpfeifer.
shuixing
 
Posts: 38
Joined: Sun Apr 13, 2014 2:08 pm

Re: stoch_simul works but estimation does not

Postby jpfeifer » Sat Jan 02, 2016 7:25 am

After estimation, you can find them in oo_.SmoothedShocks and oo_.SmoothedVariables, see the bottom of http://www.dynare.org/manual/index_27.html
Regarding the feeding in of shocks, see http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=4471
------------
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: stoch_simul works but estimation does not

Postby shuixing » Wed Jan 13, 2016 11:43 am

jpfeifer wrote:After estimation, you can find them in oo_.SmoothedShocks and oo_.SmoothedVariables, see the bottom of http://www.dynare.org/manual/index_27.html
Regarding the feeding in of shocks, see http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=4471


finally I can login this forum... I really appreciate your hellp,thanks, professor jpfeifer!
shuixing
 
Posts: 38
Joined: Sun Apr 13, 2014 2:08 pm

Re: stoch_simul works but estimation does not

Postby shuixing » Wed Jan 13, 2016 1:04 pm

jpfeifer wrote:After estimation, you can find them in oo_.SmoothedShocks and oo_.SmoothedVariables, see the bottom of http://www.dynare.org/manual/index_27.html
Regarding the feeding in of shocks, see http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=4471


I add the code
ex_=[oo_.SmoothedShocks.Median.e_a oo_.SmoothedShocks.Median.e_m]
y0=oo_.dr.ys;
dr=oo_.dr
iorder=1;
y_=simult_(y0,dr,ex_,iorder);'

in the mod.file after the estimation command line, but it reports the following error

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

Error in ==> lcmr at 305
ex_=[oo_.SmoothedShocks.Median.e_a oo_.SmoothedShocks.Median.e_m]

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

is there any details I misunderstand?
shuixing
 
Posts: 38
Joined: Sun Apr 13, 2014 2:08 pm

Re: stoch_simul works but estimation does not

Postby jpfeifer » Thu Jan 14, 2016 9:30 am

Please check which fields in oo_.SmoothedShocks exist. Maybe you only have the mean there.
------------
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: stoch_simul works but estimation does not

Postby shuixing » Thu Jan 14, 2016 3:05 pm

jpfeifer wrote:Please check which fields in oo_.SmoothedShocks exist. Maybe you only have the mean there.


dear jpfeifer, I did not do anything wiht the result just add the code lines, so the oo_.SmoothedShocks are still in oo_ field.
shuixing
 
Posts: 38
Joined: Sun Apr 13, 2014 2:08 pm

Re: stoch_simul works but estimation does not

Postby jpfeifer » Thu Jan 14, 2016 3:22 pm

I said you should check the subfields and whether they exist. Maybe there is only
Code: Select all
oo_.SmoothedShocks.Mean

and not
Code: Select all
oo_.SmoothedShocks.Median
------------
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: stoch_simul works but estimation does not

Postby shuixing » Sat Jan 16, 2016 3:04 am

jpfeifer wrote:I said you should check the subfields and whether they exist. Maybe there is only
Code: Select all
oo_.SmoothedShocks.Mean

and not
Code: Select all
oo_.SmoothedShocks.Median


hi professor jpfeifer,I have checked, and it seems only oo_.SmoothedShocks exist.
shuixing
 
Posts: 38
Joined: Sun Apr 13, 2014 2:08 pm

Re: stoch_simul works but estimation does not

Postby jpfeifer » Tue Jan 19, 2016 9:41 am

So you did not run the MCMC. In this case, take the results in
Code: Select all
oo_.SmoothedShocks
------------
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: stoch_simul works but estimation does not

Postby shuixing » Thu Jan 21, 2016 1:56 pm

jpfeifer wrote:So you did not run the MCMC. In this case, take the results in
Code: Select all
oo_.SmoothedShocks

thanks professor Jpeifer,
so I use code:

ex_=[oo_.SmoothedShocks];
y0=oo_.dr.ys;
dr=oo_.dr;
iorder=1;
y_=simult_(y0,dr,ex_,iorder);

but I get error
??? Undefined function or method 'mtimes' for input arguments of type 'struct'.

Error in ==> simult_ at 99
epsilon = dr.ghu*transpose(ex_);

Error in ==> lcmr at 324
y_=simult_(y0,dr,ex_,iorder);

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

my model is loglinearized by hand, so I think maybe iorder=1 is wrong ,then I change iorder=0,but I only get two columns of zeros in y_, what seems to be the problem?
shuixing
 
Posts: 38
Joined: Sun Apr 13, 2014 2:08 pm

Re: stoch_simul works but estimation does not

Postby jpfeifer » Sun Jan 24, 2016 7:10 pm

You need to sort this out yourself by checking the content of
Code: Select all
oo_.SmoothedShocks

The error message tells you that it is a structure. But you claimed that there are no subfields before.
------------
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

Next

Return to Dynare help

Who is online

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