# Dynare timing and redefinition

**URL:** <https://forum.dynare.org/t/dynare-timing-and-redefinition/14789>\
**Category:** Stochastic simulations\
**Created:** [27 November 2019 17:28 UTC](https://forum.dynare.org/t/dynare-timing-and-redefinition/14789 "2019-11-27T17:28:28Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![RogersH99](https://forum.dynare.org/letter_avatar_proxy/v4/letter/r/a88e57/32.png) [@RogersH99](https://forum.dynare.org/u/RogersH99)\
**Post date:** [27 November 2019 17:28 UTC](https://forum.dynare.org/t/dynare-timing-and-redefinition/14789/1 "2019-11-27T17:28:28Z")

</div>

Hi Prof, I am new to dynare and I have a puzzle on timing and redefining:

In usual stochastic growth model, suppose I have production function as y=z k^alpha, then in dynare timing it is y=z k(-1)^alpha.  
define: m=z alpha k(-1)^(alpha-1), then I focus on m(+1).  
Also define: n=z(+1) alpha k^(alpha-1).  
My questions are :

1. Are m(+1) and n the same? conceptually and numerically?
2. How do I interpret the above? Does m refers to realized value, and n refers to expected value? If NOT, how should I construct the expected & realized values in this case?

Many thanks.

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [28 November 2019 11:15 UTC](https://forum.dynare.org/t/dynare-timing-and-redefinition/14789/2 "2019-11-28T11:15:05Z")

</div>

Without knowing how m(+1) is used, it is impossible to tell. But yes, `n` is the expected value, while `m` is the realization. You may want to have a look at [Expected value of a power](https://forum.dynare.org/t/expected-value-of-a-power/2200)

---

<div class="post-metadata">

**Author:** ![RogersH99](https://forum.dynare.org/letter_avatar_proxy/v4/letter/r/a88e57/32.png) [@RogersH99](https://forum.dynare.org/u/RogersH99)\
**Post date:** [28 November 2019 13:50 UTC](https://forum.dynare.org/t/dynare-timing-and-redefinition/14789/3 "2019-11-28T13:50:37Z")

</div>

Hi Prof., Thanks for your reply!  
I am using it in an Euler equation. The original formula is  
1/c(t)=beta E\_{t} [1/c(t+1) (alpha z(t+1) k(t+1)^ (alpha-1) +1 -delta].  
If I put into dynare, i need to change k(t+1) to k(t).

So I wonder if I define m as: m= z alpha k(-1)^(alpha-1)  
Then is it correct to write the above Euler equation as:  
1/c=beta 1/c(+1) (m(+1)+1-delta) ?  
Or should I ONLY define n as: n= z(+1) alpha k^(alpha-1)  
and write 1/c=beta 1/c(+1) (n+1-delta)?

It seems that I check it computationally, the diff is around 10^-16. Both seem fine.

Thanks.

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [29 November 2019 15:14 UTC](https://forum.dynare.org/t/dynare-timing-and-redefinition/14789/4 "2019-11-29T15:14:10Z")

</div>

At first order, both are equivalent and you do not need to worry.At second order, your definition with `n` would theoretically be different, because it contains the conditional expectations.

---

<div class="post-metadata">

**Author:** ![RogersH99](https://forum.dynare.org/letter_avatar_proxy/v4/letter/r/a88e57/32.png) [@RogersH99](https://forum.dynare.org/u/RogersH99)\
**Post date:** [29 November 2019 15:19 UTC](https://forum.dynare.org/t/dynare-timing-and-redefinition/14789/5 "2019-11-29T15:19:41Z")

</div>

Hi Prof. Thanks for your reply.  
Sorry but I dont think i understand the 1st order 2nd order thing. I assume you are referring to order of perturbation. But for my understanding, whatever order I do( or if I do second order), in dynare, m refers to realized element, BUT m(+1) still contains an expectation? so still equivalent to n?

Or, i wonder whether you have any example for the 1st order and 2nd order you mentioned, for cases m(+1) and n are different?

Many thanks

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [29 November 2019 15:29 UTC](https://forum.dynare.org/t/dynare-timing-and-redefinition/14789/6 "2019-11-29T15:29:27Z")

</div>

`n= z(+1) alpha k^(alpha-1)`  
means  
n= E\_t[z\_{t+1} \alpha k\_t^{\alpha-1}]  
When you write  
1/c=\beta 1/c(+1) (n+1-\delta)  
you get  
1/c\_t=E\_t[\beta 1/c\_{t+1} (E\_t[z\_{t+1} \alpha k\_t^{\alpha-1}]+1-\delta)]  
Because of Jensen’s Inequality, this is not equal to  
1/c\_t=E\_t[\beta 1/c\_{t+1}(z\_{t+1} \alpha k\_t^{\alpha-1}+1-\delta)]  
i.e. you cannot pull the second E\_t out.

---

<div class="post-metadata">

**Author:** ![RogersH99](https://forum.dynare.org/letter_avatar_proxy/v4/letter/r/a88e57/32.png) [@RogersH99](https://forum.dynare.org/u/RogersH99)\
**Post date:** [29 November 2019 15:37 UTC](https://forum.dynare.org/t/dynare-timing-and-redefinition/14789/7 "2019-11-29T15:37:23Z")

</div>

Ohh! Got this! Thanks Prof.!

But following to that, the same problem should also occur if I use  
m=z alpha k(-1)^(alpha-1)

and put m(+1) in replace of n in the Euler equation. Because in this case, m(+1) is also an expectation term, which cannot be pulled out?

And further, if I do want to show what my original Euler equation means, under the re-definition of marginal product of capital (say, to save place), how should I do this to avoid the Jensen Inequality? Seems no alternative but type the marginal product out?

Thanks and sorry for keeping disturbing you.

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [29 November 2019 15:57 UTC](https://forum.dynare.org/t/dynare-timing-and-redefinition/14789/8 "2019-11-29T15:57:54Z")

</div>

No, in Dynare the conditional expectation is always around the full equation by definition. In the definition of the marginal product

> [@RogersH99](#):
>
> m=z alpha k(-1)^(alpha-1)

both sides are contained in the information set a time t. Thus, the conditional expectation E\_t drops out and does not shop up when you shift `m` one period into the future.

---

<div class="post-metadata">

**Author:** ![RogersH99](https://forum.dynare.org/letter_avatar_proxy/v4/letter/r/a88e57/32.png) [@RogersH99](https://forum.dynare.org/u/RogersH99)\
**Post date:** [29 November 2019 16:13 UTC](https://forum.dynare.org/t/dynare-timing-and-redefinition/14789/9 "2019-11-29T16:13:36Z")

</div>

Hi Prof., thanks for your reply.  
So it implies I should always use m and put m(+1) in my Euler equation. for n, it would cause trouble? Hence I’d better stick to m and m(+1).

Thanks again for your help and patience.

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [29 November 2019 16:16 UTC](https://forum.dynare.org/t/dynare-timing-and-redefinition/14789/10 "2019-11-29T16:16:13Z")

</div>

Yes, for the first part. For the second one, again if you are doing a first order approximation then Jensen’s Inequality will not matter because everything is linear. Problems therefore will only arise at `order>1`.

---

<div class="post-metadata">

**Author:** ![RogersH99](https://forum.dynare.org/letter_avatar_proxy/v4/letter/r/a88e57/32.png) [@RogersH99](https://forum.dynare.org/u/RogersH99)\
**Post date:** [29 November 2019 16:17 UTC](https://forum.dynare.org/t/dynare-timing-and-redefinition/14789/11 "2019-11-29T16:17:53Z")

</div>

That’s great! I am very clear now. Thanks for your help a lot!
