# Stoch\_simul at order=2 makes Octave crash

**URL:** https://forum.dynare.org/t/stoch-simul-at-order-2-makes-octave-crash/13097
**Category:** Stochastic simulations
**Created:** [15 January 2019 11:00 UTC](https://forum.dynare.org/t/stoch-simul-at-order-2-makes-octave-crash/13097 "2019-01-15T11:00:39Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![tgire](https://forum.dynare.org/letter_avatar_proxy/v4/letter/t/5fc32e/32.png) [@tgire](https://forum.dynare.org/u/tgire)
#### Post date: [15 January 2019 11:00 UTC](https://forum.dynare.org/t/stoch-simul-at-order-2-makes-octave-crash/13097/1 "2019-01-15T11:00:39Z")

</div>

Hello,

I am working with Dynare 4.5.6 and Octave 4.4.0 under Windows 7 Entreprise.  
stoch\_simul at order 2 makes Octave crash, while it works fine at order 1.

Could you please help me understand?  
Below is a code example.

Thanks a lot for your help!

Best,  
Thibaut

```
var K q;

varexo dWt;

parameters
a b delta r alpha dt sigma
K_inf q_inf;

a=1;
b=1;
delta = 0.023;
alpha = 0.33;
r = 0.01;
dt=1;
q_inf = 1+(1+a)*b*delta^a;
K_inf = (((r+delta)*q_inf-a*b*delta^(a+1))/alpha)^(1/(alpha-1));
sigma = 0.3;

model;
# I = K(-1)*((q-1)/((1+a)*b))^(1/a);
# w = alpha*K(-1)^(alpha-1)+a*b*(I/K(-1))^(a+1);
K = K(-1) + (I-delta*K(-1))*dt;
q(+1) = q + (r+delta)*q*dt - w*dt + sigma * q * dWt;
end;

steady_state_model;
K = K_inf;
q = q_inf;
end;

initval;
K = 20;
q = q_inf;
end;

endval;
K = K_inf;
q = q_inf;
end;

check;

shocks;
var dWt = dt;
end;

stoch_simul(nograph, noprint, order=2);
```

---

<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: [18 January 2019 05:56 UTC](https://forum.dynare.org/t/stoch-simul-at-order-2-makes-octave-crash/13097/2 "2019-01-18T05:56:41Z")

</div>

@sebastien Could you maybe have a look at this?

---

<div class="post-metadata">

### Author: ![sebastien](https://forum.dynare.org/user_avatar/forum.dynare.org/sebastien/32/19973_2.png) [@sebastien](https://forum.dynare.org/u/sebastien)
#### Post date: [23 January 2019 09:46 UTC](https://forum.dynare.org/t/stoch-simul-at-order-2-makes-octave-crash/13097/4 "2019-01-23T09:46:59Z")

</div>

Hi @tgire,

It works fine for me.

I suspect your problem comes from your Octave installation. The Octave developers made a mistake and first released a version of Octave which was broken (in the sense that it is not compatible with the Dynare binary), then they made another release which works fine.

Please erase your current Octave installation and reinstall it using the following link (assuming your Windows is 64-bit): [https://ftp.gnu.org/gnu/octave/windows/octave-4.4.0-w64\_1-installer.exe](https://ftp.gnu.org/gnu/octave/windows/octave-4.4.0-w64_1-installer.exe)

I think that should fix your problem. If not, please report here (ideally by giving more details, such as the crash message).

Best,

---

<div class="post-metadata">

### Author: ![tgire](https://forum.dynare.org/letter_avatar_proxy/v4/letter/t/5fc32e/32.png) [@tgire](https://forum.dynare.org/u/tgire)
#### Post date: [23 January 2019 11:13 UTC](https://forum.dynare.org/t/stoch-simul-at-order-2-makes-octave-crash/13097/5 "2019-01-23T11:13:52Z")

</div>

Thank you Sebastien it works well after reinstalling Octave.  
Thanks a lot!  
Thibaut
