#35: Putting "shocks" before "endval" leads to wrong results --------------------------+------------------------------------------------- Reporter: sebastien | Owner: Type: bug | Status: new Priority: major | Milestone: 4.1 Component: Core M-files | Version: 4.0.4 Keywords: | --------------------------+------------------------------------------------- In a deterministic setup with both temporary and permanent shocks, the order of the {{{shocks}}} and {{{endval}}} blocks matter. Actually, putting {{{shocks}}} before {{{endval}}} leads to wrong results.
{{{shocks}}} uses {{{set_shocks.m}}}, which fills in {{{oo_.exo_simul}}}; the point is that, if {{{endval}}} has not been used, this structure is empty, so {{{set_shocks}}} fills it, at date of shocks, for ''all'' the exogenous, and using the ''initial'' steady state value.
When {{{simul}}} is finally called, it completes {{{oo_.exo_simul}}} with the ''final'' exogenous steady state, but only for those periods which have no temporary shocks. So at the dates with temporary shocks, the value of exogenous which are permanently shocked is wrong.
A quick fix is to forbid the use of {{{shocks}}} before {{{endval}}}.
A cleaner fix is to modify {{{set_shocks.m}}} so that it only sets values for the exogenous which are temporarily shocked, and leaves {{{NaN}}} for other exogenous. It would be {{{simul}}}'s job to fill in the holes.
#35: Putting "shocks" before "endval" leads to wrong results ---------------------------+------------------------------------------------ Reporter: sebastien | Owner: Type: bug | Status: new Priority: major | Milestone: 4.2 Component: Core M-files | Version: 4.0.4 Resolution: | Keywords: ---------------------------+------------------------------------------------ Changes (by sebastien):
* milestone: 4.1 => 4.2
Comment:
A workaround has been implemented in r3082, for the 4.1 release: it forbids a "shocks" block before an "endval" block.
For 4.2 release, the goal is to clean up the way we construct oo_.exo_simul. The declarations "initval", "shocks" and "endval", as translated by the preprocessor, would simply add information to the M_ structure. Then the oo_.exo_simul would be constructed ex post, at the top of simul.
#35: Putting "shocks" before "endval" leads to wrong results ---------------------------+------------------------------------------------ Reporter: sebastien | Owner: Type: bug | Status: new Priority: major | Milestone: 5.0 Component: Core M-files | Version: 4.0.4 Resolution: | Keywords: ---------------------------+------------------------------------------------ Changes (by sebastien):
* milestone: 4.2 => 5.0
#35: Putting "shocks" before "endval" leads to wrong results ------------------------+------------------- Reporter: sebastien | Owner: Type: bug | Status: new Priority: major | Milestone: 5.0 Component: General | Version: 4.0.4 Resolution: | Keywords: ------------------------+-------------------
Comment (by sebastien):
Ticket #271 describes the right solution to the present ticket; both should be processed at the same time.