Learn R Programming

ldsr (version 0.0.2)

LDS_EM: Learn LDS model

Description

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.

Usage

LDS_EM(y, u, v, theta0, niter = 1000L, tol = 1e-05)

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)

theta0

A vector of initial values for the parameters

niter

Maximum number of iterations, default 1000

tol

Tolerance for likelihood convergence, default 1e-5. Note that the log-likelihood is normalized

Value

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