Learn R Programming

astsa (version 1.1)

EM1: EM Algorithm for General State Space Models

Description

Estimation of the parameters in the model (6.3) -- (6.4) via the EM algorithm. For a demonstration, see Example 6.12 on page 357.

Usage

EM1(num, y, A, mu0, Sigma0, Phi, Ups, Gam, cQ, cR, input, 
     max.iter = 50, tol = 0.01)

Arguments

num
number of observations
y
observation vector or time series; use 0 for missing values
A
observation matrices, an array with dim=c(q,p,n); use 0 for missing values
mu0
initial state mean
Sigma0
initial state covariance matrix
Phi
state transition matrix
Ups
state input matrix; set to 0 if not used
Gam
observation input matrix; set to 0 if not used
cQ
Cholesky-like decomposition of state error covariance matrix Q -- see details below
cR
R is diagonal here, so cR = sqrt(R) -- also, see details below
input
matrix or vector of inputs having the same row dimension as y; set to 0 if not used
max.iter
maximum number of iterations
tol
relative tolerance for determining convergence

Value

  • PhiEstimate of Phi
  • QEstimate of Q
  • REstimate of R
  • mu0Estimate of initial state mean
  • Sigma0Estimate of initial state covariance matrix
  • like-log likelihood at each iteration
  • niternumber of iterations to convergence
  • cvgrelative tolerance at convergence

Details

Practically, the script only requires that Q or R may be reconstructed as t(cQ)%*%(cQ) or t(cR)%*%(cR), respectively.

References

http://www.stat.pitt.edu/stoffer/tsa3/