# Conditional forecast paths in a vector

**URL:** <https://forum.dynare.org/t/conditional-forecast-paths-in-a-vector/24940>\
**Category:** Stochastic simulations\
**Created:** [9 January 2024 18:09 UTC](https://forum.dynare.org/t/conditional-forecast-paths-in-a-vector/24940 "2024-01-09T18:09:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![msangia](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/d6d6ee/32.png) [@msangia](https://forum.dynare.org/u/msangia)\
**Post date:** [9 January 2024 18:09 UTC](https://forum.dynare.org/t/conditional-forecast-paths-in-a-vector/24940/1 "2024-01-09T18:09:54Z")

</div>

Dear all,

I’m trying to set the values of the conditional forecast paths from a vector (which is stored in an Excel file). Could it be done?

Example. Instead of using:  
var y;  
periods 1, 2, 3, 4;  
values 0.8, 0.5, 0.3, 0.2;

var y;  
periods 1, 2, 3, 4;  
values my\_vector;

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 January 2024 14:05 UTC](https://forum.dynare.org/t/conditional-forecast-paths-in-a-vector/24940/2 "2024-01-10T14:05:58Z")

</div>

No, unfortunately that is not feasible. To achieve something like this, you would need to set `constrained_paths_` manually.

---

<div class="post-metadata">

**Author:** ![msangia](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/d6d6ee/32.png) [@msangia](https://forum.dynare.org/u/msangia)\
**Post date:** [10 January 2024 14:19 UTC](https://forum.dynare.org/t/conditional-forecast-paths-in-a-vector/24940/3 "2024-01-10T14:19:54Z")

</div>

Thanks Johannes!  
Best regards,

---

<div class="post-metadata">

**Author:** ![rrremedio](https://forum.dynare.org/letter_avatar_proxy/v4/letter/r/898d66/32.png) [@rrremedio](https://forum.dynare.org/u/rrremedio)\
**Post date:** [11 December 2024 15:01 UTC](https://forum.dynare.org/t/conditional-forecast-paths-in-a-vector/24940/4 "2024-12-11T15:01:15Z")

</div>

Is this still the case? I mean, the “conditional\_forecast\_paths” documentation states that _“The syntax of the block is the same as for the deterministic shocks in the `shocks` blocks”_. However if you follow the example from the same documentation, and adapted below, we get the error:

**Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 3-by-1.**

**Error in conditional\_forecast\_e.driver (line 996) constrained\_paths\_(1,1)=xx;**

**Error in dynare (line 308) evalin(‘base’,[fname ‘.driver’]);**

The example:

```auto
xx = [1.2; 1.3; 1];

%shocks
conditional_forecast_paths;
var e;
periods 1:3;
values (xx);
end;

```

---

<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:** [11 December 2024 16:20 UTC](https://forum.dynare.org/t/conditional-forecast-paths-in-a-vector/24940/5 "2024-12-11T16:20:21Z")

</div>

Can you provide me with the code you are using?

---

<div class="post-metadata">

**Author:** ![rrremedio](https://forum.dynare.org/letter_avatar_proxy/v4/letter/r/898d66/32.png) [@rrremedio](https://forum.dynare.org/u/rrremedio)\
**Post date:** [12 December 2024 10:30 UTC](https://forum.dynare.org/t/conditional-forecast-paths-in-a-vector/24940/6 "2024-12-12T10:30:54Z")

</div>

Certainly. Here is the code. Calling conditional\_forecast.mod throws the error.  
[Scripts.zip](https://forum.dynare.org/uploads/short-url/kGgoPCgYp7A3Z0BmsMiKy3caIeM.zip) (1.8 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 2024 12:39 UTC](https://forum.dynare.org/t/conditional-forecast-paths-in-a-vector/24940/7 "2024-12-13T12:39:17Z")

</div>

I can confirm that this is a bug: [Fix treatment of input vectors in conditional\_forecast\_paths (#1949) · Issues · Dynare / dynare · GitLab](https://git.dynare.org/Dynare/dynare/-/issues/1949)

---

<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:** [14 February 2025 11:04 UTC](https://forum.dynare.org/t/conditional-forecast-paths-in-a-vector/24940/8 "2025-02-14T11:04:22Z")

</div>

The bug will be fixed in Dynare 6.3.
