Skip to content
This repository has been archived by the owner. It is now read-only.

bug in conditional forecast #1276

Closed
rattoma opened this issue Sep 2, 2016 · 6 comments

Comments

Projects
None yet
4 participants
@rattoma
Copy link
Member

commented Sep 2, 2016

The conditional forecast is buggy.

Namely there is some inconsistency in indexing between decision rule and declaration order.

The way to fix it is to make sure that the pre-processor sets the vector of indices:
constrained_vars_
in decision rule order.
In fact, imcforecast assumes that constrained_vars_ is in decision rule order
Moreover, one needs to fix imcforecast for the trend, since the latter is already defined in decision-rule ordering (so no need to use inv_order_var). I am going to make a pull request with the imcforecast fix, but I do not touch the pre-processor. If someone (@houtan?) could help with the latter.
Many thanks

@rattoma

This comment has been minimized.

Copy link
Member Author

commented Sep 2, 2016

partial fix in #1277

@houtanb houtanb added the bug label Sep 5, 2016

@houtanb houtanb added this to the 4.5 milestone Sep 5, 2016

@rattoma

This comment has been minimized.

Copy link
Member Author

commented Sep 6, 2016

@houtanb In principle this could be fixed without touching the pre-processor, however I have a strange case where the preprocessor provides a non-sense index for the constrained variable, which does not match the true variable [and actually the index is even larger than the # of variables].
I am sending you the dynare files in a separate email.

@houtanb houtanb self-assigned this Sep 6, 2016

houtanb added a commit that referenced this issue Sep 6, 2016

preprocessor: fix bug in conditional_forecast_paths where the shocked…
… endogenous variable id was provided as symb_id instead of type specific symb_id. #1276
@JohannesPfeifer

This comment has been minimized.

Copy link
Contributor

commented Sep 6, 2016

@houtanb This is also present in 4.4.3, right? If yes, we should add it to the bug list. Do we know when exactly this problem occured and what it did?

@rattoma

This comment has been minimized.

Copy link
Member Author

commented Sep 7, 2016

@houtanb. I have amended and merged my PR #1277.
I tested and in works. thanks a lot!

@houtanb

This comment has been minimized.

Copy link
Member

commented Sep 7, 2016

@JohannesPfeifer this bug has existed since the feature was introduced. See line 231 of preprocessor/Shocks.cc in dbc9e09. An indexing bug (adding +1 to the index) was fixed in: 8dc1b90, but the index remained w.r.t. all variables, not just endogenous.

@houtanb

This comment has been minimized.

Copy link
Member

commented Sep 7, 2016

It should be noted that this bug would only be apparent when there are endogenous variables declared after either exogenous or parameters. If all exogenous variables are declared at the top of the .mod file, the index would be correct since the change in 8dc1b90

@houtanb houtanb added the preprocessor label Sep 7, 2016

@stepan-a stepan-a closed this Sep 7, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.