EM Algorithm for General State Space Models
Estimation of the parameters in the general state space model via the EM algorithm. Inputs are not allowed; see the note.
EM1(num, y, A, mu0, Sigma0, Phi, cQ, cR, max.iter = 100, tol = 0.001)
num |
number of observations |
y |
observation vector or time series; use 0 for missing values |
A |
observation matrices, an array with |
mu0 |
initial state mean |
Sigma0 |
initial state covariance matrix |
Phi |
state transition matrix |
cQ |
Cholesky-like decomposition of state error covariance matrix Q – see details below |
cR |
R is diagonal here, so |
max.iter |
maximum number of iterations |
tol |
relative tolerance for determining convergence |
Phi |
Estimate of Phi |
Q |
Estimate of Q |
R |
Estimate of R |
mu0 |
Estimate of initial state mean |
Sigma0 |
Estimate of initial state covariance matrix |
like |
-log likelihood at each iteration |
niter |
number of iterations to convergence |
cvg |
relative tolerance at convergence |
Inputs are not allowed (and hence not estimated). The script uses Ksmooth1 and everything related to inputs are set equal to zero when it is called.
It would be relatively easy to include estimates of 'Ups' and 'Gam' because conditional on the states, these are just regression coefficients. If you decide to alter EM1 to include estimates of the 'Ups' or 'Gam', feel free to notify me with a workable example and I'll include it in the next update.
D.S. Stoffer
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.