statsmodels.tsa.statespace.simulation_smoother.SimulationSmoothResults.simulate#

SimulationSmoothResults.simulate(simulation_output=-1, measurement_disturbance_variates=None, state_disturbance_variates=None, initial_state_variates=None, pretransformed_measurement_disturbance_variates=None, pretransformed_state_disturbance_variates=None, pretransformed_initial_state_variates=False, rng=None)[source]#

Perform simulation smoothing

Does not return anything, but populates the object’s simulated_* attributes, as specified by simulation output.

Parameters:
simulation_outputint, optional

Bitmask controlling simulation output. Default is to use the simulation output defined in object initialization.

measurement_disturbance_variatesarray_like, optional

If specified, these are the shocks to the measurement equation, \(\varepsilon_t\). If unspecified, these are automatically generated using a pseudo-random number generator. If specified, must be shaped nsimulations x k_endog, where k_endog is the same as in the state space model.

state_disturbance_variatesarray_like, optional

If specified, these are the shocks to the state equation, \(\eta_t\). If unspecified, these are automatically generated using a pseudo-random number generator. If specified, must be shaped nsimulations x k_posdef where k_posdef is the same as in the state space model.

initial_state_variatesarray_like, optional

If specified, this is the state vector at time zero, which should be shaped (k_states x 1), where k_states is the same as in the state space model. If unspecified, but the model has been initialized, then that initialization is used. Usually only specified if results are to be replicated (e.g. to enforce a seed) or for testing; if not specified, random variates are drawn.

pretransformed_measurement_disturbance_variatesbool, optional

If measurement_disturbance_variates is provided, this flag indicates whether it should be directly used as the shocks. If False, then it is assumed to contain draws from the standard Normal distribution that must be transformed using the obs_cov covariance matrix. Default is False.

pretransformed_state_disturbance_variatesbool, optional

If state_disturbance_variates is provided, this flag indicates whether it should be directly used as the shocks. If False, then it is assumed to contain draws from the standard Normal distribution that must be transformed using the state_cov covariance matrix. Default is False.

pretransformed_initial_state_variatesbool, optional

If initial_state_variates is provided, this flag indicates whether it should be directly used as the initial_state. If False, then it is assumed to contain draws from the standard Normal distribution that must be transformed using the initial_state_cov covariance matrix. Default is False.

rng{None, int, numpy.random.Generator, numpy.random.RandomState}, optional

If rng is None or an int, a new Generator is created (seeded with rng if an int is given). If rng is already a Generator or RandomState instance, that instance is used.

random_state{None, int, array_like[int], numpy.random.Generator, numpy.random.RandomState}, optional

Deprecated since version 0.15: random_state has been deprecated. In-line with SPEC-007, use rng for passing a random number generator or seed.