second order approximation for large model and Ramsey proble

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.

second order approximation for large model and Ramsey proble

Postby xiaoshan » Mon Nov 21, 2016 9:23 am

We are solving Ramsey policy for a New Keynesian DSGE model with heterogeneous agents. We used to employ Schimitt-Grohe Uribe’s code for deriving and solving Ramsey equilbiurm. However, this time due to large size of model (which due to heterogeneity), we get ‘out of memory’ warning when trying to get second order solution. The problem is that SGU’s code (e.g., gxx_hxx.m, line 35) generates a matrix when solving second order terms which is too big to be stored in Matlab. Then we are now considering solving this Ramsey problem using Dynare. My questions are:
1. Has anyone else encountered this kind of ‘out of memory’ problem when using SGU orginal code? We have total number of 120 equations (52 states) in Ramsey equilibrium. Or does anyone know how to resolve this issue, or if SGU has a modified more efficient version of their code?
2. Would the second order solution solver in Dynare be more efficient than SGU (or Kim et al) solver? In particular, can Dynare solve second order approximation for a large model of 120 equations?
3. We are also looking at multiple instruments in our Ramsey optimal policy problem. Is it possible to do Ramsey problem with multiple instruemnts in Dynare? I came across some posts saying that I may need to use ‘unstable’ version of Dynare. Any advice on this would be very helpful.
By the way, we are looking at distortedsteady state and need to solve a nonlinear Ramsey problem (thus not doing linear-quadratic problem using linearized model).
Any suggestions will be highly appreciated!
xiaoshan
 
Posts: 5
Joined: Mon Nov 21, 2016 9:00 am

Re: second order approximation for large model and Ramsey pr

Postby jpfeifer » Mon Nov 21, 2016 10:02 am

I will have to look into your question in more detail when I have more time later. But quickly: SGU have a version of their code working with sparse matrices at http://www.columbia.edu/~mu2166/2nd_order/gxx_hxx_sparse.m
Did you try that one? That would save any coversion costs.
------------
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: second order approximation for large model and Ramsey pr

Postby xiaoshan » Tue Nov 22, 2016 12:46 pm

Thank you very much for your reply, I am using gxx_hxx_sparse now. However, it seems very slow for a large model and has been running for 24 hours.

How efficient is Dynare compared with SGU original code in solving large scale models? We may still turn to Dynare to solve our model if SGU costs too much running time.

Best wishes,
Xiaoshan
xiaoshan
 
Posts: 5
Joined: Mon Nov 21, 2016 9:00 am

Re: second order approximation for large model and Ramsey pr

Postby jpfeifer » Thu Nov 24, 2016 1:49 pm

1. Dynare in principle is a lot more efficient than the SGU-codes due to storing the results differently.
2. A second order approximation of 120 equations should be possible.
3. Yes, several instruments work. But you need the unstable version, because of a bug in 4.4.3 (see http://www.dynare.org/DynareWiki/KnownBugs)
4. The part with the distorted steady state may currently be a problem. I am still in the process of investigating whether Dynare's Ramsey returns correct results in this case, see http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=10949. If you have a model I can use to test, that would be very helpful. Otherwise, it might take some time.
------------
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: second order approximation for large model and Ramsey pr

Postby xiaoshan » Mon Dec 05, 2016 3:03 pm

Hi Johannes,

The dynare code worked for my model. Thanks a lot for your suggestion!

best wishes,
Xiaoshan
xiaoshan
 
Posts: 5
Joined: Mon Nov 21, 2016 9:00 am


Return to Dynare help

Who is online

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