# Dynare - "LoadError: InexactError: Int64(NaN)" for the simplest model

**URL:** <https://discourse.julialang.org/t/dynare-loaderror-inexacterror-int64-nan-for-the-simplest-model/84284>\
**Category:** Finance and Economics\
**Tags:** question, dynare\
**Created:** [July 15, 2022, 6:10pm UTC](https://discourse.julialang.org/t/dynare-loaderror-inexacterror-int64-nan-for-the-simplest-model/84284 "2022-07-15T18:10:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![geekbear](https://avatars.discourse-cdn.com/v4/letter/g/c5a1d2/32.png) [@geekbear](https://discourse.julialang.org/u/geekbear)\
**Post date:** [July 15, 2022, 6:10pm UTC](https://discourse.julialang.org/t/dynare-loaderror-inexacterror-int64-nan-for-the-simplest-model/84284/1 "2022-07-15T18:10:12Z")

</div>

Hi! I was computing the transition path in the perfect foresight Solow growth model from a given initial capital stock, and keep getting “LoadError: InexactError: Int64(NaN)” when I tried to run the .mod file. I can’t figure out what went wrong given that the code is so simple (please see below). Can someone help me out here? Many many thanks!

var k;

parameters alpha, delta, s;

alpha = 1/3;  
delta = 0.05;  
s = 0.1;

model;  
k = (1-s)\*k(-1)^alpha + (1-delta)\*k(-1);  
end;

steady\_state\_model;  
k = (delta/(1-s))^(1/(alpha-1));  
end;

histval;  
k(0) = 1;  
end;

perfect\_foresight\_setup(periods = 300);  
perfect\_foresight\_solver;

---

<div class="post-metadata">

**Author:** ![RJDennis](https://avatars.discourse-cdn.com/v4/letter/r/90db22/32.png) [@RJDennis](https://discourse.julialang.org/u/RJDennis)\
**Post date:** [July 15, 2022, 6:15pm UTC](https://discourse.julialang.org/t/dynare-loaderror-inexacterror-int64-nan-for-the-simplest-model/84284/2 "2022-07-15T18:15:33Z")

</div>

Maybe k(0) needs to be a Float?

Try

```julia
k(0) = 1.0

```

---

<div class="post-metadata">

**Author:** ![geekbear](https://avatars.discourse-cdn.com/v4/letter/g/c5a1d2/32.png) [@geekbear](https://discourse.julialang.org/u/geekbear)\
**Post date:** [July 15, 2022, 6:22pm UTC](https://discourse.julialang.org/t/dynare-loaderror-inexacterror-int64-nan-for-the-simplest-model/84284/3 "2022-07-15T18:22:06Z")

</div>

Thanks but still getting the same error message.

---

<div class="post-metadata">

**Author:** ![geekbear](https://avatars.discourse-cdn.com/v4/letter/g/c5a1d2/32.png) [@geekbear](https://discourse.julialang.org/u/geekbear)\
**Post date:** [July 15, 2022, 8:16pm UTC](https://discourse.julialang.org/t/dynare-loaderror-inexacterror-int64-nan-for-the-simplest-model/84284/4 "2022-07-15T20:16:38Z")

</div>

Btw, this is the command I used to run the mod file:

using Dynare  
context = @dynare “./solow.mod”;

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [July 15, 2022, 8:47pm UTC](https://discourse.julialang.org/t/dynare-loaderror-inexacterror-int64-nan-for-the-simplest-model/84284/5 "2022-07-15T20:47:48Z")

</div>

This doesn’t look like valid Julia syntax. What is this, and what is a mod-file? Please provide context and self-contained code.

Reading this should help: [Please read: make it easier to help you](https://discourse.julialang.org/t/please-read-make-it-easier-to-help-you/14757)

Edit: OK, I see now the Dynare package loading. The OP was just really confusing.

---

<div class="post-metadata">

**Author:** ![MichelJuillard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/micheljuillard/32/10555_2.png) [@MichelJuillard](https://discourse.julialang.org/u/MichelJuillard)\
**Post date:** [July 16, 2022, 8:30am UTC](https://discourse.julialang.org/t/dynare-loaderror-inexacterror-int64-nan-for-the-simplest-model/84284/6 "2022-07-16T08:30:49Z")

</div>

Thank you for reporting the problem! The current implementation of perfect foresight simulation assumes a shock to an exogenous variable. Your model is perfectly valid on principle, we need to cover the case without exogenous variable or shocks. Wait please for the next release.

P.S. In the future, please refrain to post the same question here and on [https://forum.dynare.org/](https://forum.dynare.org/). This forces us to answer twice.

---

<div class="post-metadata">

**Author:** ![MichelJuillard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/micheljuillard/32/10555_2.png) [@MichelJuillard](https://discourse.julialang.org/u/MichelJuillard)\
**Post date:** [July 16, 2022, 8:10pm UTC](https://discourse.julialang.org/t/dynare-loaderror-inexacterror-int64-nan-for-the-simplest-model/84284/7 "2022-07-16T20:10:49Z")

</div>

@geekbear We release v0.5.3 that should fix the problem for models without exogenous variables or shocks. Thanks again for alerting us of the problem

---

<div class="post-metadata">

**Author:** ![geekbear](https://avatars.discourse-cdn.com/v4/letter/g/c5a1d2/32.png) [@geekbear](https://discourse.julialang.org/u/geekbear)\
**Post date:** [July 16, 2022, 8:18pm UTC](https://discourse.julialang.org/t/dynare-loaderror-inexacterror-int64-nan-for-the-simplest-model/84284/8 "2022-07-16T20:18:55Z")

</div>

Thanks so much. I’m new to the community and will not duplicate posts in the future.
