Kalman_smoother {ldsr} | R Documentation |
Implement Kalman smoothing
Description
Estimate the hidden state and expected log-likelihood given the observations, exogeneous input and system parameters. This is an internal function and should not be called directly.
Usage
Kalman_smoother(y, u, v, theta, stdlik = TRUE)
Arguments
y |
Observation matrix (may need to be normalized and centered before hand) (q rows, T columns) |
u |
Input matrix for the state equation (m_u rows, T columns) |
v |
Input matrix for the output equation (m_v rows, T columns) |
theta |
A list of system parameters (A, B, C, D, Q, R)' |
stdlik |
Boolean, whether the likelihood is divided by the number of observations. Standardizing the likelihood this way may speed up convergence in the case of long time series. |
Value
A list of fitted elements (X, Y, V, J, and lik)
Note
This code only works on one dimensional state and output at the moment. Therefore, transposing is skipped, and matrix inversion is treated as /, and log(det(Sigma)) is treated as log(Sigma).