Univariate treatment (sequential processing) of the multivariate Kalman filter and smoother equations for fast implementation. Refer to Koopman and Durbin (2000).
kalmanUnivariate(X, a0_0, P0_0, A, Lambda, Sig_e, Sig_u)logl log-likelihood of the innovations from the Kalman filter
at_t \(k \times n\), filtered state mean vectors
Pt_t \(k \times k \times n\), filtered state covariance matrices
at_n \(k \times n\), smoothed state mean vectors
Pt_n \(k \times k \times n\), smoothed state covariance matrices
Pt_tlag_n \(k \times k \times n\), smoothed state covariance with lag
n x p, numeric matrix of (stationary) time series
k x 1, initial state mean vector
k x k, initial state covariance matrix
k x k, state transition matrix
p x k, measurement matrix
p x p, measurement equation residuals covariance matrix (diagonal)
k x k, state equation residuals covariance matrix
For full details of the univariate filtering approach, please refer to Mosley et al. (2023). Note that \(n\) is the number of observations, \(p\) is the number of time series, and \(k\) is the number of states.
Koopman, S. J., & Durbin, J. (2000). Fast filtering and smoothing for multivariate state space models. Journal of Time Series Analysis, 21(3), 281-296.
Mosley, L., Chan, TS., & Gibberd, A. (2023). sparseDFM: An R Package to Estimate Dynamic Factor Models with Sparse Loadings.