Fix bug in dyn_forecast.m where forecasts after an initval block where computed at the initial values and not at the steady state

This contradicted the manual (histval must be used to do this). Also clarifies the manual on this.
time-shift
Johannes Pfeifer 2014-12-08 08:45:32 +01:00 committed by Johannes Pfeifer
parent 58387f00e9
commit 1c01bacf36
2 changed files with 24 additions and 9 deletions

View File

@ -2160,20 +2160,24 @@ commands (@code{stoch_simul}, @code{estimation}@dots{}).
It is not necessary to declare @code{0} as initial value for exogenous
stochastic variables, since it is the only possible value.
This steady state will be used as the initial condition at all the
periods preceeding the first simulation period for the two possible
The subsequently computed steady state (not the initial values, use @xref{histval} or this) will be used as the initial condition at all the
periods preceeding the first simulation period for the three possible
types of simulations in stochastic mode:
@itemize
@item
in @code{stoch_simul}, if the @code{periods} options is specified
in @xref{stoch_simul}, if the @code{periods} options is specified
@item
in @code{forecast} (in this case, note that it is still possible to
modify some of these initial values with @code{histval})
in @xref{forecast} as the initial point at which the forecasts are computed
@item
in @xref{conditional_forecast} as the initial point at which the conditional forecasts are computed
@end itemize
To start simulations at a particular set of starting values that are not a computed steady state, use @xref{histval}.
@optionshead
@table @code
@ -2386,11 +2390,22 @@ before (except when a @code{steady} command doesn't follow an
@customhead{In a stochastic simulation context}
In the context of stochastic simulations, @code{histval} allows setting
the starting point of those simulations in the state space (it does not
affect the starting point for impulse response functions). As for the case of
the starting point of those simulations in the state space. As for the case of
perfect foresight simulations, all not explicitly specified variables are set to 0.
Moreover, as only states enter the recursive policy functions, all values specified for control variables will be ignored.
@itemize
@item
in @xref{stoch_simul}, if the @code{periods} options is specified. Note that this only affects the starting point for the simulation, but not for the impulse response functions.
@item
in @xref{forecast} as the initial point at which the forecasts are computed
@item
in @xref{conditional_forecast} as the initial point at which the conditional forecasts are computed
@end itemize
For @ref{Ramsey} policy, it also specifies the values of the endogenous states at
which the objective function of the planner is computed. Note that the initial values
of the Lagrange multipliers associated with the planner's problem cannot be set
@ -6247,7 +6262,7 @@ Fields are of the form:
@deffn Command conditional_forecast (@var{OPTIONS}@dots{}) [@var{VARIABLE_NAME}@dots{}];
@anchor{conditional_forecast}
@descriptionhead
This command computes forecasts on an estimated or calibrated model for a

View File

@ -64,7 +64,7 @@ switch task
horizon = 5;
end
if isempty(M_.endo_histval)
y0 = repmat(oo_.steady_state,1,maximum_lag);
y0 = repmat(oo_.dr.ys,1,maximum_lag);
else
y0 = M_.endo_histval;
end