# Basic rbc model with temporary and permanent shocks

**URL:** https://forum.dynare.org/t/basic-rbc-model-with-temporary-and-permanent-shocks/4798
**Category:** Dynare contributions and examples
**Created:** [28 June 2015 20:45 UTC](https://forum.dynare.org/t/basic-rbc-model-with-temporary-and-permanent-shocks/4798 "2015-06-28T20:45:36Z")
**Posts on this page:** 1
**Showing post:** 6

<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: [9 January 2023 18:01 UTC](https://forum.dynare.org/t/basic-rbc-model-with-temporary-and-permanent-shocks/4798/6 "2023-01-09T18:01:57Z")

</div>

An alternative is to have both a stationary and a unit root shock in an undetrended model:

```auto
var y, c, k, a, h, a_temp, a_perm;
varexo e, u;

parameters beta, rho, alpha, delta, theta, psi, tau;

alpha = 0.36;
rho = 0.95;
tau = 0.025;
beta = 0.99;
delta = 0.025;
psi = 0;
theta = 2.95;

phi = 0.1;

model;
c*theta*h^(1+psi)=(1-alpha)*y;
k = beta*(c/c(+1))*(alpha*y(+1)+(1-delta)*k);
y = exp(a)*(k(-1)^alpha)*(h^(1-alpha));
k = (y-c)+(1-delta)*k(-1);
a = a_temp+a_perm;
a_temp=rho*a_temp(-1) + e;
a_perm=a_perm(-1) + u;
end;

initval;
y = 1.08068253095672;
c = 0.80359242014163;
h = 0.29175631001732;
k = 11.08360443260358;
a = 0;
a_temp = 0;
a_perm= 0;
e = 0;
u = 0;
end;

shocks;
var e; stderr 1;
var u; stderr 1;
end;
check;
stoch_simul(order=1,irf=200);

```

---

_[View the full topic](https://forum.dynare.org/t/basic-rbc-model-with-temporary-and-permanent-shocks/4798)._
