# Automating input to conditional forecast command

**URL:** <https://forum.dynare.org/t/automating-input-to-conditional-forecast-command/6200>\
**Category:** Dynare help (legacy posts)\
**Created:** [10 May 2017 05:36 UTC](https://forum.dynare.org/t/automating-input-to-conditional-forecast-command/6200 "2017-05-10T05:36:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![clauper](https://forum.dynare.org/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@clauper](https://forum.dynare.org/u/clauper)\
**Post date:** [10 May 2017 05:36 UTC](https://forum.dynare.org/t/automating-input-to-conditional-forecast-command/6200/1 "2017-05-10T05:36:30Z")

</div>

Dear all,

I would like to automate conditional forecasts, such that I don’t have to manually insert the vector of values into my .mod file.

The only way I can think of is to invoke the underlying matlab function icforecast(…) after I have run the estimation in dynare. Are there any caveats/problems with this approach?

Thanks in advance!

---

<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:** [10 May 2017 13:55 UTC](https://forum.dynare.org/t/automating-input-to-conditional-forecast-command/6200/2 "2017-05-10T13:55:07Z")

</div>

That should work. A potential problem may be the global variables used by `imcforecast`. You need to make sure they exist and are correctly set. The previous estimation-command you suggest should do that. What exactly do you mean with

> [@](#):
>
> automate

?

---

<div class="post-metadata">

**Author:** ![clauper](https://forum.dynare.org/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@clauper](https://forum.dynare.org/u/clauper)\
**Post date:** [10 May 2017 15:48 UTC](https://forum.dynare.org/t/automating-input-to-conditional-forecast-command/6200/3 "2017-05-10T15:48:49Z")

</div>

By automate I mean to have a routine that lets me do conditional forecasting for different (vectorized) variable paths without manually copying them to the “values”-line in the conditional\_forecast block of the .mod file. Thanks for your help!

---

<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:** [12 May 2017 06:28 UTC](https://forum.dynare.org/t/automating-input-to-conditional-forecast-command/6200/4 "2017-05-12T06:28:44Z")

</div>

Yes, in that case you need to set the input argument

```auto
constrained_paths
```

of the

```auto
imcforecast
```

function.

---

<div class="post-metadata">

**Author:** ![Carson](https://forum.dynare.org/letter_avatar_proxy/v4/letter/c/e9bcb4/32.png) [@Carson](https://forum.dynare.org/u/Carson)\
**Post date:** [24 January 2019 09:22 UTC](https://forum.dynare.org/t/automating-input-to-conditional-forecast-command/6200/5 "2019-01-24T09:22:39Z")

</div>

Could anybody solve the same problem they mentioned above? I followed the guider of dynare and then input a vector (xx) in the values line…But dynare didn’t work…It seems that I have to type in every data in the values line??

Thank you for your answer.

---

<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:** [24 January 2019 12:51 UTC](https://forum.dynare.org/t/automating-input-to-conditional-forecast-command/6200/6 "2019-01-24T12:51:03Z")

</div>

I would need to see the example.
