2nd order decision rule

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.

2nd order decision rule

Postby MarcosValli » Mon Apr 27, 2009 1:57 am

Hi,

I am solving a relatively big DSGE model using Dynare version 4.0.3:

MODEL SUMMARY
Number of variables: 260
Number of stochastic shocks: 1
Number of state variables: 86
Number of jumpers: 26
Number of static variables: 154

I did not have problems with the 1st order approximation, when all the irf`s were plotted correctly.
Only changing to "order=2", to run the 2nd approximation, the log file did not report errors, but all the irf 's values are NaN.

Since Dynare computed all the decision rule matrixes, I was trying to reconstruct the 2nd order decision rule using Matlab, only to understand better what is happening.

However, reading the manual about the order of the variables, and checking the matrixes, I found that the values in oo_.dr.ys are in the declaration order and not in alphabetical order as reported in the manual (pag. 25: “– ys: oo_.dr.ys. The vector rows correspond to variables in alphabetical order of the variable names.”).

I have the following questions:
1 - Why did Dynare not report errors, if it did not compute the irf 's? Could I assume that the matrixes are correct?
2 - Is there any tip about how to check if the 2nd order approximation matrixes of the decision rule were correctly computed?
3 - What is the correct order of the values in the matrixes of the 2nd order approximation of decision rule? Alphabetical or declaration order?
4 – Did Dynare use exactly the same Matlab codes of Schmitt-Grobe&Uribe? Did it use Symbolic Math Toolbox or other numerical routines for computing the derivatives?

Best regards,
Marcos Valli.
MarcosValli
 
Posts: 2
Joined: Sun Apr 26, 2009 11:53 pm

Re: 2nd order decision rule

Postby MichelJuillard » Mon Apr 27, 2009 5:17 am

Dear Marcos,
MarcosValli wrote:I did not have problems with the 1st order approximation, when all the irf`s were plotted correctly.
Only changing to "order=2", to run the 2nd approximation, the log file did not report errors, but all the irf 's values are NaN.

This is a known problem with 2nd order aproximation: the IRFs may explode as in your case. Using Chris Sims "pruning" all terms above 2nd order would work in that case

MarcosValli wrote:Since Dynare computed all the decision rule matrixes, I was trying to reconstruct the 2nd order decision rule using Matlab, only to understand better what is happening.

However, reading the manual about the order of the variables, and checking the matrixes, I found that the values in oo_.dr.ys are in the declaration order and not in alphabetical order as reported in the manual (pag. 25: “– ys: oo_.dr.ys. The vector rows correspond to variables in alphabetical order of the variable names.”).


We have recently updated the manual to match version 4.0. Please look for the new version on the web site.

MarcosValli wrote:I have the following questions:
1 - Why did Dynare not report errors, if it did not compute the irf 's? Could I assume that the matrixes are correct?

This isn't a computing error, so I'm not sure that an error message would help. You can assume that the matrices are correct
MarcosValli wrote: 2 - Is there any tip about how to check if the 2nd order approximation matrixes of the decision rule were correctly computed?

You can check that the second order approximation of the model is satisfied by the decision rule, but this is messy.
MarcosValli wrote: 3 - What is the correct order of the values in the matrixes of the 2nd order approximation of decision rule? Alphabetical or declaration order?

In version 4, the basic order is order of declaration, but the coefficient matrices are re-orderd as described in the manual
MarcosValli wrote: 4 – Did Dynare use exactly the same Matlab codes of Schmitt-Grobe&Uribe? Did it use Symbolic Math Toolbox or other numerical routines for computing the derivatives?

We use our own code, probably more efficient than SGU for large models. The results should be exactly the same. We checked on the small examples in their original paper (but the matrices reported are not the same. The state space isn't the same: in SGU exogenous variables can be autocorrelated, when in Dynare, they must be endogenous and it is the innovation that is exogenous).

Best

Michel
MichelJuillard
 
Posts: 680
Joined: Thu Nov 18, 2004 10:51 am


Return to Dynare help

Who is online

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