Potential typo in manual: third-order approximations

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.

Potential typo in manual: third-order approximations

Postby JCross » Fri Dec 30, 2016 8:07 am

Dear Johannes (and other Dynare users),

I'm currently trying to back out the state space representation of a third order approximation from Dynare's storage structure and am concerned that the manual (link: http://www.dynare.org/manual/index_26.html) has an important typo in the discussion of the G2 matrix in the third-order approximation.

The concern is in the following line:
Also note that for those pairs where $i_1 \neq i_2$, since the element is stored only once but appears two times in the unfolded $G_2$ matrix, it must be multiplied by 2 when computing the decision rules.


The reason that there may be a typo is that when I run an exercise using a simple RBC model, I found that only by multiplying ALL of the unfolded version of G2 by 2 can I match the second-order matrices C, D and E as defined in the second-order approximation section of the manual (i.e. 2*oo_.dr_2 returns a folded version of the structures oo_dr.ghxx, oo_dr.ghuu and oo_dr.ghxu). If this is correct (i.e. these matrices should be equivalent) then the manual should state that all elements in the folded matrix must be multiplied by 2 (not only those columns associated with non-squared terms of the approximation).

Also, if my above intuition is right then a second issue arises in the discussion about the G3 matrix. More precisely, do we multiply cross-product terms of order 1 by 6, cross-product terms of order 2 by 3 and leave terms of order 3 as they are? If not, what would be the correct way of recovering the coefficients? A guess based on the previous case of the G2 matrix would be that we simply need to multiply all values in the G3 matrix by 3.

Thankyou for your time,

Jamie
JCross
 
Posts: 2
Joined: Fri Dec 30, 2016 7:54 am

Re: Potential typo in manual: third-order approximations

Postby jpfeifer » Sun Jan 01, 2017 7:35 pm

We will investigate the issue. You can track it at https://github.com/DynareTeam/dynare/issues/1368
------------
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: Potential typo in manual: third-order approximations

Postby jpfeifer » Wed Jan 25, 2017 1:27 pm

Dear Jamie,
I am convinced that the description in the manual is indeed correct. If you read carefully, you will note that for the description of second order, there are the 1/n! factorial prefactors from the Taylor expansion. 'Second order terms like oo_.dr.ghuu enter with a weight of 1/2. Third order terms would enter with a weight of 1/6.

However, in the description of third order, these factorial terms are omitted. Each of the G_i terms enters with a weight of 1. Therefore, at order=2

Code: Select all
1/2*ghxx=G_2


from which follows that
Code: Select all
ghxx=2*G_2

which is exactly what you report.

Therefore, the factor 2 (or 3 and 6 mentioned in the manual for order=3) only has to do with the unfolding, not the Taylor approximation itself.
------------
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: Potential typo in manual: third-order approximations

Postby JCross » Wed Jan 25, 2017 10:10 pm

Dear Johannes,

Thankyou for checking this. It's good to know that the issue is a personal miss-interpretation rather than an issue with the coding/manual.

Thanks again for your time,
Jamie
JCross
 
Posts: 2
Joined: Fri Dec 30, 2016 7:54 am


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 5 guests