# Some questions with deterministic simulation

**URL:** <https://forum.dynare.org/t/some-questions-with-deterministic-simulation/17123>\
**Category:** Stochastic simulations\
**Created:** [13 December 2020 07:47 UTC](https://forum.dynare.org/t/some-questions-with-deterministic-simulation/17123 "2020-12-13T07:47:42Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![chenxin](https://forum.dynare.org/letter_avatar_proxy/v4/letter/c/ee59a6/32.png) [@chenxin](https://forum.dynare.org/u/chenxin)\
**Post date:** [13 December 2020 07:47 UTC](https://forum.dynare.org/t/some-questions-with-deterministic-simulation/17123/1 "2020-12-13T07:47:43Z")

</div>

Dear Sir,  
I use dynare 4.5.7 to simulat，I want to simulate in a deterministic model，but the results are very strange.The simulated trajectory map of consumption and capital stock is two straight lines， I wonder why there is no dynamics, many thanks!  
[simulation.mod](https://forum.dynare.org/uploads/short-url/2RAfKDL2LsdpWx7h7madolEiN6m.mod) (2.9 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:** [13 December 2020 09:08 UTC](https://forum.dynare.org/t/some-questions-with-deterministic-simulation/17123/2 "2020-12-13T09:08:51Z")

</div>

I get the message:

> Failed to solve perfect foresight model

That should explain the output. You are getting returned the starting values. Try 4.6.3 with

```auto
simul (periods = 200,robust_lin_solve);

```

---

<div class="post-metadata">

**Author:** ![chenxin](https://forum.dynare.org/letter_avatar_proxy/v4/letter/c/ee59a6/32.png) [@chenxin](https://forum.dynare.org/u/chenxin)\
**Post date:** [14 December 2020 01:51 UTC](https://forum.dynare.org/t/some-questions-with-deterministic-simulation/17123/3 "2020-12-14T01:51:34Z")

</div>

Thank you, dear professor with this method, my problem has been solved, you are the benchmark of my study！ 😀

---

<div class="post-metadata">

**Author:** ![chenxin](https://forum.dynare.org/letter_avatar_proxy/v4/letter/c/ee59a6/32.png) [@chenxin](https://forum.dynare.org/u/chenxin)\
**Post date:** [29 December 2020 08:25 UTC](https://forum.dynare.org/t/some-questions-with-deterministic-simulation/17123/4 "2020-12-29T08:25:15Z")

</div>

Dear Dr.feifer,I am doing deterministic simulation experiments with different shocks recently, but MATLAB there are errors in the running process, I do not know how to solve these errors, please guide ![simulation.mod|attachment](https://forum.dynare.org/uploads/default/original/2X/0/0998658554595997a94ecbed82ce8a4cb6d644c0.mod) (3.0 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:** [29 December 2020 12:42 UTC](https://forum.dynare.org/t/some-questions-with-deterministic-simulation/17123/5 "2020-12-29T12:42:31Z")

</div>

Your attachment is broken.

---

<div class="post-metadata">

**Author:** ![chenxin](https://forum.dynare.org/letter_avatar_proxy/v4/letter/c/ee59a6/32.png) [@chenxin](https://forum.dynare.org/u/chenxin)\
**Post date:** [30 December 2020 00:43 UTC](https://forum.dynare.org/t/some-questions-with-deterministic-simulation/17123/6 "2020-12-30T00:43:10Z")

</div>

[simulation.mod](https://forum.dynare.org/uploads/short-url/AmzfwcrEt5qRw1MiWG1FGM9V8pT.mod) (3.0 KB) Uploading: simulation.mod… I have re-uploaded model file[simulation.mod](https://forum.dynare.org/uploads/short-url/AmzfwcrEt5qRw1MiWG1FGM9V8pT.mod) (3.0 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:** [30 December 2020 09:06 UTC](https://forum.dynare.org/t/some-questions-with-deterministic-simulation/17123/7 "2020-12-30T09:06:44Z")

</div>

Are you sure your shock size is correct? Shouldn’t the shocks be smaller by a factor of 100? In nonlinear models that matters.

---

<div class="post-metadata">

**Author:** ![chenxin](https://forum.dynare.org/letter_avatar_proxy/v4/letter/c/ee59a6/32.png) [@chenxin](https://forum.dynare.org/u/chenxin)\
**Post date:** [30 December 2020 09:15 UTC](https://forum.dynare.org/t/some-questions-with-deterministic-simulation/17123/8 "2020-12-30T09:15:33Z")

</div>

My two shocks are labor shock and money supply shock respectively. Do you mean to set both shocks to less than one？

---

<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:** [30 December 2020 09:19 UTC](https://forum.dynare.org/t/some-questions-with-deterministic-simulation/17123/9 "2020-12-30T09:19:28Z")

</div>

What I am saying is that if your model variables are in logs and therefore in percent, then specifying

```auto
shocks;
var em0;
periods 2:6;
values 1.8;
end; 

```

for

```auto
m0-log(m0s)=rhom0*(m0(-1)-log(m0s))+em0; %m0冲击

```

implies that each period there is 1.8=180% shock happening. If you want 1.8%, then use `0.018`. Also check whether you want `m0` to be above steady state by this value or whether you want to shock it every period by this value. In the latter case, the deviations will accumulate massively.

---

<div class="post-metadata">

**Author:** ![chenxin](https://forum.dynare.org/letter_avatar_proxy/v4/letter/c/ee59a6/32.png) [@chenxin](https://forum.dynare.org/u/chenxin)\
**Post date:** [30 December 2020 09:21 UTC](https://forum.dynare.org/t/some-questions-with-deterministic-simulation/17123/10 "2020-12-30T09:21:53Z")

</div>

Okay, prof. feifer, I see what you mean

---

<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 January 2021 07:40 UTC](https://forum.dynare.org/t/some-questions-with-deterministic-simulation/17123/12 "2021-01-05T07:40:08Z")

</div>

They are not the same. Do

```auto
rplot m ;
rplot l;
rplot m0;

```

to see that the second simply causes tiny movements that are dwarfed by the other shock.
