# Conditional\_forecast\_paths; number of constrained variables

**URL:** <https://forum.dynare.org/t/conditional-forecast-paths-number-of-constrained-variables/17485>\
**Category:** Stochastic simulations\
**Created:** [11 February 2021 13:07 UTC](https://forum.dynare.org/t/conditional-forecast-paths-number-of-constrained-variables/17485 "2021-02-11T13:07:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ste](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/76d3ee/32.png) [@Ste](https://forum.dynare.org/u/Ste)\
**Post date:** [11 February 2021 13:07 UTC](https://forum.dynare.org/t/conditional-forecast-paths-number-of-constrained-variables/17485/1 "2021-02-11T13:07:44Z")

</div>

Dear Dynare developers,  
I want to compute the forecast for 3 variables in my estimated model. This model features 162 endogenous variables and 11 exogenous shocks. After the estimation command I write:  
_conditional\_forecast\_paths;_  
_var Yobs;_  
_periods 1:8;_  
_values 0.04;_  
_var PIEobs;_  
_periods 1:8;_  
_values 0.4226;_  
_var PBYobs;_  
_periods 1:8;_  
_values 1.3690;_  
_end;_  
_conditional\_forecast(parameter\_set=posterior\_mean, controlled\_varexo= (epsm, epsa, epsmu, epsp, epsphi, epsg, epstau, epsw,_  
_epsb,epsc\_ME, epspby\_ME), replic = 1000);_  
But I get the error message:  
" Error using imcforecast (line 222)  
imcforecast:: The number of constrained variables doesn’t match the number of controlled shocks".  
How can I solve it?  
Thanks in advance for your help.  
Ste

---

<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 February 2021 08:10 UTC](https://forum.dynare.org/t/conditional-forecast-paths-number-of-constrained-variables/17485/2 "2021-02-12T08:10:55Z")

</div>

Dynare does not allow you to find the “most likely combination of shocks”, rather it does model inversion. You need to have exactly as many `controlled_varexo` as variables you want to control.

---

<div class="post-metadata">

**Author:** ![Ste](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/76d3ee/32.png) [@Ste](https://forum.dynare.org/u/Ste)\
**Post date:** [14 February 2021 16:50 UTC](https://forum.dynare.org/t/conditional-forecast-paths-number-of-constrained-variables/17485/3 "2021-02-14T16:50:19Z")

</div>

Thanks a lot for your clarification. It works perfectly!  
Best,  
Ste
