# Pure Random Walk Shock and the Detrend

**URL:** https://forum.dynare.org/t/pure-random-walk-shock-and-the-detrend/26532
**Category:** Stochastic simulations
**Created:** [5 October 2024 05:45 UTC](https://forum.dynare.org/t/pure-random-walk-shock-and-the-detrend/26532 "2024-10-05T05:45:20Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![JPT](https://forum.dynare.org/letter_avatar_proxy/v4/letter/j/58f4c7/32.png) [@JPT](https://forum.dynare.org/u/JPT)
#### Post date: [5 October 2024 05:45 UTC](https://forum.dynare.org/t/pure-random-walk-shock-and-the-detrend/26532/1 "2024-10-05T05:45:20Z")

</div>

Hello, I have a conceptual question regarding the pure random walk shock and the de-trending process in a model.

Specifically, I am trying to replicate the model of Eric Swanson in this [paper](https://sites.socsci.uci.edu/~swanson2/papers/ezap.pdf), which features recursive preferences and a pure random walk for productivity.

When I de-trend all variables by A\_t (and value function by log(A\_t)), the de-trended variables only include the next period’s shock (eps\_A(+1)), but not eps\_A.  
Since Dynare only allows for shocks to occur in the current period, these shocks appear to have no effect on the economy after de-trending.  
On the other hand, if I do not de-trend the variables and put them into Dynare and perform Stoch\_simul, the shock to eps\_A does seem to have an effect on the model. However, this is very puzzling to me since eps\_A do not appear in the de-trended equations.

Am I missing something in the de-trending process, or is there another way to properly handle these shocks in the model? Can this be due to multiple equilibrium?

Thank you in advance for your help!

- Attached, the Detrended.mod gives the one de-trended by hand; the nondetrended one gives the non-linear equations as in the paper WITHOUT detrending. Again, I believe they should yield the same results, but in the former one the detrended variable does not move; on the latter, it moves.

[EZ\_Detrended.mod](https://forum.dynare.org/uploads/short-url/t2Gt37xdnSqJlaSPaLWqFbwhqP9.mod) (2.5 KB)  
[EZ\_Notdetrended.mod](https://forum.dynare.org/uploads/short-url/3cuiwrbvKbUcHHEjQl9nJwgZfmH.mod) (2.5 KB)

---

<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: [5 October 2024 06:51 UTC](https://forum.dynare.org/t/pure-random-walk-shock-and-the-detrend/26532/2 "2024-10-05T06:51:11Z")

</div>

1. I am not sure I understand. In the non-detrended version `eps_A` clearly affects variables.
2. If you detrend, you should detrend by `A(-1)`.
