Adding support for dates in perfect_foresight_setup
The user should be able to control the dates of the dseries
simulated_time_series produced by
perfect_foresight_solver via perfect_foresight_setup.
Currently, options of perfect foresight simulations work as follows:
initval_file has two inputs, a dseries (for historical values, first guesses and terminal values) and a first date of the simulation named
first_simulation_period. An alternative is to set with the input
first_obs the dates used for the first initial conditions. Values of the dseries are passed to
perfect_foresight_setup, but the first simulation period is not used and the dseries
simulated_time_series generated by
perfect_foresight_solver starts at period 1 instead of the first simulation period.
• There exists an internal option
options_, but this option is unused.
• The user also provides the input periods to
perfect_foresight_setup and it is used by
perfect_foresight_solver in order to generate the good size for
In order to deal properly with fist and last dates of simulations, we would like:
• First, in order to be consistent with the date concept used in dseries, to name corresponding options with “date” names instead of “period” names, i.e.
last_simulation_date for first and last dates of simulations.
first_simulation_date sets the first date of the perfect foresight simulation through
perfect_foresight_setup. Must be consistent with
initval_file. It is an alternative to specifying
first_obs and must be consistent if
first_obs is also used as an option. Values for initial conditions before this date must be available.
last_simulation_date sets the last date of simulation through
perfect_foresight_setup. Combined with
first_simulation_date, this date should determine the number of periods (last date minus first date plus one) and the
periods option would not be necessary in this context. It must be consistent with
periods if it is also used as an option. Data for terminal conditions past the last period must be available.
• Fourth, we would like
simulated_time_series to be dated and to contain simulated values in the range going from first to last simulation dates. Be careful that the first row of data of
simulated_time_series changes depending on the presence of lags and leads in the endogenous variables of the model (i.e. it contains the data corresponding to the first date before the first simulated period when the model only contains lags. However, it contains the first simulated period when the model has leads or a mix of leads and lags). Dynare should set the internal option
first_simulation_period-1 depending on the lead-lag context.
• Fifth, consistent treatments could be developed in the case of the usage of
histval_file. Similarly, if
first_obs is used, the treatment must be consistent with
histval_file if they are used.
(this ticket updates and replaces this public one: #1745)