Histval and shocks declaration with repeated deterministic simulations

If somebody could reply to this I would be really grateful… Many thanks!

Dear all,
I have a question regarding the use of histval and the declaration of shocks within a repeated deterministic simulation, i.e. a simulation where in say period 5, new information regarding the exogenous variables is revealed. I use Dynare 4.4.3.

Specifically, if I declare the shocks, followed by simul, then use histval to set the state variables to their period 4 values from this first simulation, then declare new shocks (which were not part of the original shock block), followed by again by simul, is it true that the shocks from both the first shock block and the second shock block will be executed in the second simulation?

Also, is it correct that if one were to use initval instead of histval, only those shocks declared after initval would be executed (this is my understanding, and I was assuming that the same holds for histval, hence my interest in finding out exactly what is going on if I use histval)?

To make myself clear, I attach a .mod file with a very simple model, with three shocks (epsi_b, epsi_c and epsi_d). The simulation I want to conduct is as follows:

-epsi_b takes a value of 1 on impact
-epsi_d takes a value of 10 in simulation period 8

At the beginning of period 5, new information is revealed:
-epsi_c takes a value of 5 in simulation simulation period 10

However, as expected epsi_d will take a value of 10 in simulation period 8.

I think that the attached file labelled example_histval_1.mod implements this simulation

Is this correct? By contrast, example_histval_2.mod is wrong because it fails to set epsi_b=0 in the period during which new information is revealed (hence it is executed again, as mandated by shock block 1).

Furthermore, example_histval_3.mod fails to take into account that the configuration of epsi_d in shock block 1 implies that epsi_d will be executed in period 8 of the new information era (unless explicitly set to zero in shock block 2).

Finally, is it correct that if the economy is supposed to return to its original steady state, I don’t have to declare histval following initval?

Many thanks for your help!
example_histval.zip (2.2 KB)