State space representation of a time series process
Parameters: | k_endog : array_like or integer
k_states : int
k_posdef : int, optional
initial_variance : float, optional
initialization : {‘approximate_diffuse’,’stationary’,’known’}, optional
initial_state : array_like, optional
initial_state_cov : array_like, optional
nobs : integer, optional
dtype : dtype, optional
design : array_like, optional
obs_intercept : array_like, optional
obs_cov : array_like, optional
transition : array_like, optional
state_intercept : array_like, optional
selection : array_like, optional
state_cov : array_like, optional
**kwargs :
|
---|
Notes
A general state space model is of the form
y_t & = Z_t \alpha_t + d_t + \varepsilon_t \\ \alpha_t & = T_t \alpha_{t-1} + c_t + R_t \eta_t \\
where y_t refers to the observation vector at time t, \alpha_t refers to the (unobserved) state vector at time t, and where the irregular components are defined as
\varepsilon_t \sim N(0, H_t) \\ \eta_t \sim N(0, Q_t) \\
The remaining variables (Z_t, d_t, H_t, T_t, c_t, R_t, Q_t) in the equations are matrices describing the process. Their variable names and dimensions are as follows
Z : design (k\_endog \times k\_states \times nobs)
d : obs_intercept (k\_endog \times nobs)
H : obs_cov (k\_endog \times k\_endog \times nobs)
T : transition (k\_states \times k\_states \times nobs)
c : state_intercept (k\_states \times nobs)
R : selection (k\_states \times k\_posdef \times nobs)
Q : state_cov (k\_posdef \times k\_posdef \times nobs)
In the case that one of the matrices is time-invariant (so that, for example, Z_t = Z_{t+1} ~ \forall ~ t), its last dimension may be of size 1 rather than size nobs.
References
[R79] | Durbin, James, and Siem Jan Koopman. 2012. Time Series Analysis by State Space Methods: Second Edition. Oxford University Press. |
Attributes
nobs | int | The number of observations. |
k_endog | int | The dimension of the observation series. |
k_states | int | The dimension of the unobserved state process. |
k_posdef | int | The dimension of a guaranteed positive definite covariance matrix describing the shocks in the measurement equation. |
shapes | dictionary of name:tuple | A dictionary recording the initial shapes of each of the representation matrices as tuples. |
initialization | str | Kalman filter initialization method. Default is unset. |
initial_variance | float | Initial variance for approximate diffuse initialization. Default is 1e6. |
Methods
bind(endog) | Bind data to the statespace representation |
initialize_approximate_diffuse([variance]) | Initialize the statespace model with approximate diffuse values. |
initialize_known(initial_state, ...) | Initialize the statespace model with known distribution for initial state. |
initialize_stationary() | Initialize the statespace model as stationary. |
Methods
bind(endog) | Bind data to the statespace representation |
initialize_approximate_diffuse([variance]) | Initialize the statespace model with approximate diffuse values. |
initialize_known(initial_state, ...) | Initialize the statespace model with known distribution for initial state. |
initialize_stationary() | Initialize the statespace model as stationary. |
Attributes
design | (array) Design matrix: Z~(k\_endog \times k\_states \times nobs) |
dtype | (dtype) Datatype of currently active representation matrices |
endog | (array) The observation vector, alias for obs. |
obs | (array) Observation vector: y~(k\_endog \times nobs) |
obs_cov | (array) Observation covariance matrix: |
obs_intercept | (array) Observation intercept: d~(k\_endog \times nobs) |
prefix | (str) BLAS prefix of currently active representation matrices |
selection | (array) Selection matrix: R~(k\_states \times k\_posdef \times nobs) |
state_cov | (array) State covariance matrix: Q~(k\_posdef \times k\_posdef \times nobs) |
state_intercept | (array) State intercept: c~(k\_states \times nobs) |
time_invariant | (bool) Whether or not currently active representation matrices are |
transition | (array) Transition matrix: T~(k\_states \times k\_states \times nobs) |