# Dimension of dr\_.ghx awkard (zeros omitted?)

**URL:** <https://forum.dynare.org/t/dimension-of-dr--ghx-awkard-zeros-omitted/220>\
**Category:** Dynare help (legacy posts)\
**Created:** [2 January 2007 19:45 UTC](https://forum.dynare.org/t/dimension-of-dr--ghx-awkard-zeros-omitted/220 "2007-01-02T19:45:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![matrose](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/d2c977/32.png) [@matrose](https://forum.dynare.org/u/matrose)\
**Post date:** [2 January 2007 19:45 UTC](https://forum.dynare.org/t/dimension-of-dr--ghx-awkard-zeros-omitted/220/1 "2007-01-02T19:45:43Z")

</div>

Hi,

I want to build a state transition and measurement equation from the decision rules that DYNARE produces. For my DSGE model, dr\_.ghx is roughly of dimension 70 by 200. That seems awkward to me as it seems to imply that there is less variables (70) in the model than there is states (200). My model is such that DYNARE automatically generates some states, but I would assume that it also reports transition equations as part of the output in dr\_.ghx.

Could it be, that DYNARE does not include transition rules in dr\_.ghx when the entries are zero? In other words, can I just assume that what is missing are zeros?

Thanks a lot for any comments - Matthias

---

<div class="post-metadata">

**Author:** ![MichelJuillard](https://forum.dynare.org/user_avatar/forum.dynare.org/micheljuillard/32/5318_2.png) [@MichelJuillard](https://forum.dynare.org/u/MichelJuillard)\
**Post date:** [3 January 2007 19:45 UTC](https://forum.dynare.org/t/dimension-of-dr--ghx-awkard-zeros-omitted/220/2 "2007-01-03T19:45:31Z")

</div>

dr.ghx isn’t the transition matrix. It is the coefficient of all endogenous variables as a function of state variables

Most likely your model has lags on more than one period.  
dr\_.ghx doesn’t contain either the auxiliary equations required to get a transition matrix in that case.

Best

Michel

---

<div class="post-metadata">

**Author:** ![matrose](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/d2c977/32.png) [@matrose](https://forum.dynare.org/u/matrose)\
**Post date:** [3 January 2007 20:31 UTC](https://forum.dynare.org/t/dimension-of-dr--ghx-awkard-zeros-omitted/220/3 "2007-01-03T20:31:43Z")

</div>

Michel,

thanks for the reply. I would like to construct the state transition equation from the output of DYNARE. Is that possible? For models with just one period lag, I believe that this can be done from dr\_.ghx and dr\_.ghu. But how can I compute the state transition equation for models with more than one period lag?

Thanks for your help  
Matthias

---

<div class="post-metadata">

**Author:** ![MichelJuillard](https://forum.dynare.org/user_avatar/forum.dynare.org/micheljuillard/32/5318_2.png) [@MichelJuillard](https://forum.dynare.org/u/MichelJuillard)\
**Post date:** [4 January 2007 09:52 UTC](https://forum.dynare.org/t/dimension-of-dr--ghx-awkard-zeros-omitted/220/4 "2007-01-04T09:52:30Z")

</div>

In version 3,

the transition equation is

> [@](#):
>
> yhat\_{t} = A yhat\_{t-1}+B u\_{t}

where yhat\_t is the vector of endogenous variables less the steady state, augmented of lagged state variables when there are lags on more than one period.

A is square matrix with zero columns corresponding to endogenous variables that aren’t state variables (don’t appear in the model with a lag)

You can obtain A and B matrix with the following expression

> [@](#):
>
> [A, B] = kalman\_transition\_matrix(dr\_)

to be place after stoch\_simul

The variables are in the same order as in dr\_.ghx, the auxiliary lagged variables come at the end of the vector.

The is currently no simple way to obtain the transition matrix in version 4. I will write such a function

Best

Michel

---

<div class="post-metadata">

**Author:** ![dupko](https://forum.dynare.org/letter_avatar_proxy/v4/letter/d/f14d63/32.png) [@dupko](https://forum.dynare.org/u/dupko)\
**Post date:** [13 August 2012 10:25 UTC](https://forum.dynare.org/t/dimension-of-dr--ghx-awkard-zeros-omitted/220/5 "2012-08-13T10:25:57Z")

</div>

[quote=“MichelJuillard”]In version 3,

the transition equation is

> [@](#):
>
> yhat\_{t} = A yhat\_{t-1}+B u\_{t}

where yhat\_t is the vector of endogenous variables less the steady state, augmented of lagged state variables when there are lags on more than one period.

A is square matrix with zero columns corresponding to endogenous variables that aren’t state variables (don’t appear in the model with a lag)

You can obtain A and B matrix with the following expression

> [@](#):
>
> [A, B] = kalman\_transition\_matrix(dr\_)

to be place after stoch\_simul

The variables are in the same order as in dr\_.ghx, the auxiliary lagged variables come at the end of the vector.

The is currently no simple way to obtain the transition matrix in version 4. I will write such a function

Best

Michel[/quote]

Thats working,thanks M 😛 ichel
