# Error Syntax "Unexpected EXP"

**URL:** https://forum.dynare.org/t/error-syntax-unexpected-exp/12455
**Category:** Stochastic simulations
**Created:** [22 September 2018 02:51 UTC](https://forum.dynare.org/t/error-syntax-unexpected-exp/12455 "2018-09-22T02:51:39Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![bluesky2009](https://forum.dynare.org/letter_avatar_proxy/v4/letter/b/e36b37/32.png) [@bluesky2009](https://forum.dynare.org/u/bluesky2009)
#### Post date: [22 September 2018 02:51 UTC](https://forum.dynare.org/t/error-syntax-unexpected-exp/12455/1 "2018-09-22T02:51:39Z")

</div>

Hello, I am trying to replicate a paper.  
I change all the variable x to exp(x) to get log-linear approximation. Then I got the following error when runing the .mod file.  
Starting preprocessing of the model file …  
ERROR: CF18lab.mod: line 147, cols 5-7: syntax error, unexpected EXP

Ps: before changing all variables x to exp(x) =, everthing is ok.  
Is there any one ever encountered this issue or know how to solve it, plz leave me an advice!

Thanks a lot!

---

<div class="post-metadata">

### Author: ![stepan-a](https://forum.dynare.org/user_avatar/forum.dynare.org/stepan-a/32/6652_2.png) [@stepan-a](https://forum.dynare.org/u/stepan-a)
#### Post date: [22 September 2018 08:02 UTC](https://forum.dynare.org/t/error-syntax-unexpected-exp/12455/2 "2018-09-22T08:02:33Z")

</div>

It is difficult to identify the issue without the mod file… I do not know what you wrote around around line 147, or if this line is in the model block. If you log linearise the whole model, you can alternatively use the `loglinear` option in `stoch_simul`.

Best,  
Stéphane.

---

<div class="post-metadata">

### Author: ![bluesky2009](https://forum.dynare.org/letter_avatar_proxy/v4/letter/b/e36b37/32.png) [@bluesky2009](https://forum.dynare.org/u/bluesky2009)
#### Post date: [22 September 2018 12:37 UTC](https://forum.dynare.org/t/error-syntax-unexpected-exp/12455/3 "2018-09-22T12:37:29Z")

</div>

Thanks a lot, I just messaged you relating the mod file.  
Best,

---

<div class="post-metadata">

### Author: ![bluesky2009](https://forum.dynare.org/letter_avatar_proxy/v4/letter/b/e36b37/32.png) [@bluesky2009](https://forum.dynare.org/u/bluesky2009)
#### Post date: [23 September 2018 11:59 UTC](https://forum.dynare.org/t/error-syntax-unexpected-exp/12455/4 "2018-09-23T11:59:43Z")

</div>

The problem solved. I should not have changed all variable x to exp(x) in both model and intval block.  
If I change only in model block from x to exp(x); and keep x= ln(…) in the intval block, it works well! You need to provide initial values of the declared variable directly x=…; not exp(x)=…, dynare cannot understand implicitly the initial values.  
Thank Stephane for pointing out this.
