# Horizon and Macroprocessor

**URL:** <https://forum.dynare.org/t/horizon-and-macroprocessor/18987>\
**Category:** Perfect foresight simulations\
**Created:** [28 September 2021 17:38 UTC](https://forum.dynare.org/t/horizon-and-macroprocessor/18987 "2021-09-28T17:38:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sahil](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/f6c823/32.png) [@sahil](https://forum.dynare.org/u/sahil)\
**Post date:** [28 September 2021 17:38 UTC](https://forum.dynare.org/t/horizon-and-macroprocessor/18987/1 "2021-09-28T17:38:47Z")

</div>

Hi,

I want to implement a news shock for different horizon, and I am doing the following:  
model;  
.  
.  
.  
**@#for T in [“3”, “7”, “10”]**  
i=phi\_pi_pi+phi\_y_y+**nu(-@{T}));**

end;

shocks;  
var eps\_nu;  
periods 1;  
values -0.025;  
var zlb;  
periods 1:_@{T};_  
values 1;  
end;

perfect\_foresight\_setup(periods=300);  
perfect\_foresight\_solver;  
**@#endfor**

But this is not working, could anyone please help me?

Thank you in anticipation.

Best Regards  
Sahil

---

<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 September 2021 06:54 UTC](https://forum.dynare.org/t/horizon-and-macroprocessor/18987/2 "2021-09-29T06:54:10Z")

</div>

Please provide the full file.

---

<div class="post-metadata">

**Author:** ![sahil](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/f6c823/32.png) [@sahil](https://forum.dynare.org/u/sahil)\
**Post date:** [29 September 2021 08:47 UTC](https://forum.dynare.org/t/horizon-and-macroprocessor/18987/3 "2021-09-29T08:47:06Z")

</div>

Dear Professor,

Thank you for your reply. Please find that attached, and please use the run.m file to run the model. My aim is to compare the response with different horizons and produce figures as I have done in the end of the Matlab file.

Thank you.

Best Regards  
Sahil[NK\_horizon.mod](https://forum.dynare.org/uploads/short-url/2oh657K8TIeo43zwD3AwdHwj2CS.mod) (7.2 KB)  
[run.m](https://forum.dynare.org/uploads/short-url/rD60Ee9yQi8k5EvKZsF57GTTL7O.m) (1.7 KB)

---

<div class="post-metadata">

**Author:** ![sahil](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/f6c823/32.png) [@sahil](https://forum.dynare.org/u/sahil)\
**Post date:** [29 September 2021 08:49 UTC](https://forum.dynare.org/t/horizon-and-macroprocessor/18987/4 "2021-09-29T08:49:49Z")

</div>

Sorry, I uploaded the wrong file. Please use this mod file instead. [NK\_horizon.mod](https://forum.dynare.org/uploads/short-url/2lRWyxwYDfyFnaml10Q9S71NIGh.mod) (7.3 KB)

Apologies.

---

<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 September 2021 12:56 UTC](https://forum.dynare.org/t/horizon-and-macroprocessor/18987/5 "2021-09-29T12:56:40Z")

</div>

Try with the `savemacro`-command line option whether the attached file yields the desired outcome.  
[NK\_horizon.mod](https://forum.dynare.org/uploads/short-url/HOUwRWjkd0yjLSmH7ACLaVEi8t.mod) (7.3 KB)
