Estimate the hidden state and model parameters given observations and exogenous inputs using the EM algorithm. This is the key backend routine of this package.
LDS_EM(y, u, v, theta0, niter = 1000L, tol = 1e-05)
Observation matrix (may need to be normalized and centered before hand) (q rows, T columns)
Input matrix for the state equation (m_u rows, T columns)
Input matrix for the output equation (m_v rows, T columns)
A vector of initial values for the parameters
Maximum number of iterations, default 1000
Tolerance for likelihood convergence, default 1e-5. Note that the log-likelihood is normalized
A list of model results
theta: model parameters (A, B, C, D, Q, R, mu1, V1) resulted from Mstep
fit: results of Estep
liks : vector of loglikelihood over the iteration steps