Page 1 of 1

Potential typo in manual: third-order approximations

PostPosted: Fri Dec 30, 2016 8:07 am
by JCross
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

Re: Potential typo in manual: third-order approximations

PostPosted: Sun Jan 01, 2017 7:35 pm
by jpfeifer
We will investigate the issue. You can track it at https://github.com/DynareTeam/dynare/issues/1368

Re: Potential typo in manual: third-order approximations

PostPosted: Wed Jan 25, 2017 1:27 pm
by jpfeifer
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.

Re: Potential typo in manual: third-order approximations

PostPosted: Wed Jan 25, 2017 10:10 pm
by JCross
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