statsmodels.tsa.statespace.kalman_filter.KalmanFilter.simulate
-
KalmanFilter.simulate(nsimulations, measurement_shocks=None, state_shocks=None, initial_state=None)[source] -
Simulate a new time series following the state space model
Parameters: - nsimulations (int) – The number of observations to simulate. If the model is time-invariant this can be any number. If the model is time-varying, then this number must be less than or equal to the number
-
measurement_shocks (array_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
nsimulationsxk_endog, wherek_endogis the same as in the state space model. -
state_shocks (array_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
nsimulationsxk_posdefwherek_posdefis the same as in the state space model. -
initial_state (array_like, optional) – If specified, this is the state vector at time zero, which should be shaped (
k_statesx 1), wherek_statesis the same as in the state space model. If unspecified, but the model has been initialized, then that initialization is used. If unspecified and the model has not been initialized, then a vector of zeros is used. Note that this is not included in the returnedsimulated_statesarray.
Returns: - simulated_obs (array) – An (nsimulations x k_endog) array of simulated observations.
- simulated_states (array) – An (nsimulations x k_states) array of simulated states.
© 2009–2012 Statsmodels Developers
© 2006–2008 Scipy Developers
© 2006 Jonathan E. Taylor
Licensed under the 3-clause BSD License.
http://www.statsmodels.org/stable/generated/statsmodels.tsa.statespace.kalman_filter.KalmanFilter.simulate.html