If a solution corresponding to 100% of the shock can’t be found in the first
informational period, marginal linearization will be performed to extrapolate a
solution.
However, in subsequent informational periods, this extrapolated solution cannot
be used for the initial conditions of endogenous variables, because the initial
conditions are not a true solution of the nonlinear model. For those subsequent
informational periods, the correct approach is to compute the two solutions
needed for marginal linearization using as initial conditions the values
obtained in the same two solutions for the previous informational
periods (stored as oo_.deterministic_simulation.{sim1,sim2}).
Similarly to the regular “endval” block, any variable mentioned in this
block will jump to its new value in the period where the information is learnt.
In particular, this means that any temporary shock that may have been
anticipated on that variable (as specified through a “shocks(learnt_in=...)”
block for a previous informational period) will be overwritten.
– new option “endval_steady” to pf_setup command to recompute terminal
steady state in the homotopy loop
– new options “homotopy_linearization_fallback” and
“homotopy_marginal_linearization_fallback” to pf_solver and pfwee_solver
commands, to get an approximate solution when homotopy fails to go to 100%
– new options “homotopy_initial_step_size”, “homotopy_min_step_size”,
“homotopy_step_size_increase_success_count” and “homotopy_max_completion_share”
to pf_solver and pfwee_solver commands to fine tune the homotopy behaviour
– removed option “homotopy_alt_starting_point” to pf_solver command, not really
useful
– new options “steady_solve_algo”, “steady_tolf”, “steady_tolx”,
“steady_maxit”, “steady_markowitz” to pf_solver and pfwee_solver commands, to
control the computation of the terminal steady state (and remove the
equivalent options which previously had different names in pfwee_solver command)
– Remove the terminal_steady_state_as_guess_value option to pfwee_solver
– pfwee_setup now sets the same guess values as pf_setup (i.e. terminal steady
state at all periods)
– With constant_simulation_length option, pfwee_solver uses terminal steady
state as guess values for periods that are added to the simulation
Previously, LBJ was available:
– under stack_solve_algo=6 when neither block nor bytecode were present
– under stack_solve_algo=1 with either block or bytecode (but the documentation
was not making it clear that it was LBJ)
This commit merges the two values for the option, and makes them
interchangeable. LBJ should now be invoked with stack_solve_algo=1 (but
stack_solve_algo=6 is kept for compatibility, and is a synonymous).
A bug was introduced in 440a0e460b, erroneously
changing the name of the baseline for a comparison.
The bug was left unnoticed with recent versions of MATLAB and on Octave,
because the first array in the ensuing comparison had zero line, and because of
automatic broadcasting, the error message was not triggered.
However, the bug was exposed on MATLAB < R2016b.
These command solve the problem where agents think they know perfectly the
future (they behave as in perfect foresight), but make expectation errors.
Hence they can potentially be surprised in every period, and their expectations
about the future (incl. the final steady state) may change.
Currently the sequence of information sets needs to be passed through a CSV
file. Another interface may be added in the future.
The algorithm uses a sequence of (true) perfect foresight simulations (not
necessarily as many as there are periods, because if the information set does
not change between two periods, there is no need to do a new computation).
There are two possibilities for guess values:
— the default is to use the initial steady state for the simulation using the
first-period information set; then use previously simulated values as guess
values
— alternatively, with the terminal_steady_state_as_guess_value option, use the
terminal steady state as guess value for all future periods (this is actually
what the “true” perfect foresight solver does by default)
Several tests need to be adapted, because they were implicitly making the
assumption that there is no auxiliary variable.
Incidentally, this closes#1731. This commit therefore also removes the
workaround introduced in 0391dbbeb1.
Under Octave, having namespaces called “get” and “set” overshadows the builtin
functions with the same names, which are needed for graphics manipulation.
Therefore we go back to the initial function naming scheme, but moving all
those functions under an “accessors” subdirectory.
Among other things, this is a revert of
e4134ab59b and
c5e86fcb59.
Ref. !1655, !1686