analytic_derivation help

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.

analytic_derivation help

Postby federico » Fri May 10, 2013 2:29 pm

Hi everyone,
I'm trying to estimate a very simple NKM using ML and the analytic_derivation command.
Everything seems to work quite well untill now.
I would like to know if there is anyway to save the Jacobian and the Hessian matrix that boil down triggering the analytic_derivation command.
It's seems in fact that dynare( version 4.3.2) store both the matrices in a folder called "tmp_derivs" but this folder is only temporary. Am I correct?
Is there a way to save them?

Thanx you very much in advance.

Federico
federico
 
Posts: 68
Joined: Fri Mar 30, 2012 4:46 pm

Re: analytic_derivation help

Postby rattoma » Fri May 10, 2013 3:07 pm

Hi Federico,

which Jacobian and Hessian do you need? For the estimated params at the mode the analytic Hessian is saved on the mode file.
Marco
rattoma
 
Posts: 51
Joined: Tue Jan 04, 2005 10:48 am

Re: analytic_derivation help

Postby federico » Fri May 10, 2013 3:24 pm

Sorry, I missed that. It's what i need. Sorry again.
Just to be sure the mat file hh is the hessian while xparam1 is the Jacobian?
And what are the files stored in the "tmp_derivs" folder?

Thanx again Marco

Federico
federico
 
Posts: 68
Joined: Fri Mar 30, 2012 4:46 pm

Re: analytic_derivation help

Postby rattoma » Fri May 10, 2013 3:38 pm

Hi,

hh is the hessian, while xparam1 is the vector of parameters.
Then I guess you would ask for the gradient of the likelihood: this is not saved in the mode file.
If I remember correctly g1.mat for mode_compute=4 and m1.mat for mode_compute=5 should include variables named g* for the gradient.
rattoma
 
Posts: 51
Joined: Tue Jan 04, 2005 10:48 am

Re: analytic_derivation help

Postby federico » Fri May 10, 2013 3:51 pm

Yes, I nedd the hessian and the gradient of the likelihood.
unfortunately it seems that there is no g1.mat using mode_compute =4 and mode_compute =5 but the estimation does not even start .
( I 'm using octave versione 3.6.4 and dynare 4.3.2) . Previously I used mode_compute = 8 but still nothing ( Anyway both under 4 and 8 the estimation was fine).
Any other suggestion on How i could obtain the jacobian?


Federico
federico
 
Posts: 68
Joined: Fri Mar 30, 2012 4:46 pm

Re: analytic_derivation help

Postby federico » Mon May 13, 2013 8:35 am

Sorry, I made another mistake.
Using mode_compute = 4 there is a mat file called g1. If this file contains the gradient I have what I need.

So just to be sure.

the hessian (evaluate at the posterior mode) is saved under the filename.mode.mat in the hh.mat file
while the gradient (evaluate at the posterior mode) is saved under the g1.mat file (using mode_compute =4)?
federico
 
Posts: 68
Joined: Fri Mar 30, 2012 4:46 pm

Re: analytic_derivation help

Postby jpfeifer » Mon May 13, 2013 9:48 am

Yes. hh is the Hessian and g1 contains the Jacobian (at the respective mode).
------------
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


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 8 guests