Page 1 of 1

Identification Tools -- memory issue?

PostPosted: Fri Jun 09, 2017 2:02 pm
by erlingnb
Hi People
I am trying to use the Identification Tools (developed by Ratto) in Dynare. I have a pretty large model (perhaps 80 parameters, 25 shocks), and when I run the model I get the following error message:

Starting Dynare (version 4.4.3).
Starting preprocessing of the model file ...
Substitution of endo lags >= 2: added 10 auxiliary variables and equations.
Found 288 equation(s).
Evaluating expressions...done
Computing static model derivatives:
- order 1
- order 2
- derivatives of Jacobian/Hessian w.r. to parameters
Computing dynamic model derivatives:
- order 1
- order 2
- derivatives of Jacobian/Hessian w.r. to parameters
terminate called after throwing an instance of 'St9bad_alloc'
what(): std::bad_alloc

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.



Not really sure what is going on. I googled "terminate called after throwing an instance of 'St9bad_alloc'", and to me it looks like this is a C++ error, and has something to do with running out of memory.

Is there a way to fix some of the parameters, so that Dynare doesn't need to take the derivatives of all the parameters?

Thanks!

Re: Identification Tools -- memory issue?

PostPosted: Fri Jun 09, 2017 4:08 pm
by jpfeifer
Please try the unstable version where you have a 64bit preprocessor.

Re: Identification Tools -- memory issue?

PostPosted: Mon Jun 12, 2017 10:21 am
by erlingnb
jpfeifer wrote:Please try the unstable version where you have a 64bit preprocessor.
Thanks! I will try version 4.5.

But does anyone know if it is possible to fix some of the parameters, so Dynare doesn't use processing capacity on taking derivatives wrt all paramaters?

Re: Identification Tools -- memory issue?

PostPosted: Mon Jun 12, 2017 6:08 pm
by jpfeifer
In this case, you would need to hardcode the values. The preprocessor will try to take the derivative with respect to everything that is defined in
Code: Select all
parameters ...;

Re: Identification Tools -- memory issue?

PostPosted: Thu Jun 15, 2017 11:12 am
by erlingnb
Thanks for suggestions.

We have now tried Dynare Version 4.5.0 and also a new server with 64 gb of memory. It seems like Dynare is able to compute the derivatives wrt the parameters, but it crashes when "testing prior mean". Memory usage goes to 99% while taking the derivatives and while testing the prior mean. After a while Matlab crashes and it creates a file called "hs_err_pid5296.mdmp" which (after googling) seems to indicate an out-of-memory-problem.

Any suggestions on how to proceed? Do you think that the model size or the number of parameters are a problem?

Re: Identification Tools -- memory issue?

PostPosted: Fri Jun 16, 2017 7:57 am
by jpfeifer
It is a combination of model size and number of parameters. What you could try is limit the derivative order with respect to the parameters via the
Code: Select all
params_derivs_order

option of the preprocessor. See the manual

Re: Identification Tools -- memory issue?

PostPosted: Fri Jun 16, 2017 9:21 am
by erlingnb
jpfeifer wrote:It is a combination of model size and number of parameters. What you could try is limit the derivative order with respect to the parameters via the
Code: Select all
params_derivs_order

option of the preprocessor. See the manual

Thank you, Johannes! This actually worked very well! But can you kindly explain what we lose in terms of identification when we specify "params_derivs_order=1"? The full procedure took less than a minute now. We tried to read the manual, but we didn't get any answers.

We have a couple of more questions, though:
1. Our model has around 70-80 parameters, but we only see the identification strength graph for 26 parameters. Is this a figure limit, or what is going on?
2. We get negative values for some parameters in the identification strength graph. Is this normal? How do we interpret that?
3. Dynare doesn't save the results of the identification or any graphs in our folder -- it seems it does not create an identification folder. How can we fix this?

Thank you so much for your kind help! You are of great assistance!

Re: Identification Tools -- memory issue?

PostPosted: Sat Jun 17, 2017 3:25 pm
by jpfeifer
If I understand it correctly, we don't lose anything for identification, as it only relies on the Jacobian, not on the Hessian. See https://github.com/DynareTeam/dynare/issues/1187

1. Can you provide me with the file to have a deeper look?
2. Identification strength is measured in logs. For the interpretation, see Pfeifer (2014): "An Introduction to Graphs in Dynare" at https://sites.google.com/site/pfeiferecon/dynare
3. Again, I would need to see the file.

Re: Identification Tools -- memory issue?

PostPosted: Mon Jun 19, 2017 8:31 am
by erlingnb
jpfeifer wrote:If I understand it correctly, we don't lose anything for identification, as it only relies on the Jacobian, not on the Hessian. See https://github.com/DynareTeam/dynare/issues/1187

1. Can you provide me with the file to have a deeper look?
2. Identification strength is measured in logs. For the interpretation, see Pfeifer (2014): "An Introduction to Graphs in Dynare" at https://sites.google.com/site/pfeiferecon/dynare
3. Again, I would need to see the file.


Hi
Thank you for your reply. We have sent you a private message regarding the files. Looking forward to hearing from you.
Thanks a lot!

Re: Identification Tools -- memory issue?

PostPosted: Thu Jun 22, 2017 8:05 am
by jpfeifer
Hi, I had a look at the file
1. The reason that there are only 26 parameters is that identification strenght is only tested for estimated parameters. Your estimated_params-block contains 26 parameters.
3. When I run the file, the graphs are stored in
nb_nemo_model/identification

Re: Identification Tools -- memory issue?

PostPosted: Wed Jun 28, 2017 8:35 am
by erlingnb
jpfeifer wrote:Hi, I had a look at the file
1. The reason that there are only 26 parameters is that identification strenght is only tested for estimated parameters. Your estimated_params-block contains 26 parameters.
3. When I run the file, the graphs are stored in
nb_nemo_model/identification

Dear Johannes,
Thank you for looking at our file, and for pointing out the (rather embarrassing) mistake from our side. We managed to get identification results for all relevant parameters now. Thanks a lot!

One more question on interpreting the results: In your very helpful paper, An Introduction to Graphs in Dynare, on page 33, you write that "the larger the absolute value of the bars, the stronger is the identification." Ratto, however, writes that "the model parameters on the x-axis are ranked in increasing order of strength of identification." (link to the paper provided below). This makes me a little confused on how to interpret large negative values. Are these parameters well identified (large absolute value), or weakly identified (parameters with negative values are always pushed to the left in the graphs). Is this related to the log-scale? So large negative values (in logs) are actually close to zero (when raised to the power of e)?

Thank you for clearing up! We deeply appreciate your assistance.

Ratto paper (page 40): https://www.ifk-cfs.de/fileadmin/downlo ... fFinal.pdf

Re: Identification Tools -- memory issue?

PostPosted: Thu Jun 29, 2017 7:58 am
by jpfeifer
Thanks for pointing out this mistake in my paper. Of course, I was wrong and Marco is right. Due to the use of a log-scale, no identification would mean a value of -Inf, with stronger identification meaning bigger values. The graph is indeed ordered in direction of increasing identification strength (measured relative to the parameter value). I have updated the pdf online.

Re: Identification Tools -- memory issue?

PostPosted: Thu Jun 29, 2017 8:10 am
by erlingnb
jpfeifer wrote:Thanks for pointing out this mistake in my paper. Of course, I was wrong and Marco is right. Due to the use of a log-scale, no identification would mean a value of -Inf, with stronger identification meaning bigger values. The graph is indeed ordered in direction of increasing identification strength (measured relative to the parameter value). I have updated the pdf online.

Okay, thanks! Glad I could be of some assistance!