Computes the expected value of random variables involving Y. Users can also use print( MLEobj, what="Ey")
to access this output. See print.marssMLE
.
MARSShatyt( MLEobj, only.kem = TRUE )
A marssMLE
object with the par
element of estimated parameters, model
element with the model description and data.
Return only ytT, OtT, yxtT, and yxttpT (values conditioned on the data from 1:T). If only.kem
If TRUE, only return (and compute) values needed for the EM algorithm. If only.kem=FALSE, then also return values conditioned on data from 1 to t-1 (Ott1 and ytt1) and 1 to t (Ott and ytt), yxtt1T (E[Y(t),X(t-1)|1:T]), var.ytT (var[Y(t)|1:T]), and var.EytT (var_X[E_Y|x[Y(t)|1:T,x(t)]]).
A list with the following components (n is the number of state processes). Following the notation in Holmes (2012), y(1) is the observed data (for t=1:T) while y(2) is the unobserved data. y(1,1:t-1) is the observed data from time 1 to t-1.
E[Y(t) | Y(1,1:T)=y(1,1:T)] (n x T matrix).
E[Y(t) | Y(1,1:t-1)=y(1,1:t-1)] (n x T matrix).
E[Y(t) | Y(1,1:t)=y(1,1:t)] (n x T matrix).
E[Y(t) t(Y(t)) | Y(1,1:T)=y(1,1:T)] (n x n x T array).
var[Y(t) | Y(1,1:T)=y(1,1:T)] (n x n x T array).
var_X[E_Y|x[Y(t) | Y(1,1:T)=y(1,1:T), X(t)=x(t)]] (n x n x T array).
E[Y(t) t(Y(t)) | Y(1,1:t-1)=y(1,1:t-1)] (n x n x T array).
E[Y(t) t(Y(t)) | Y(1,1:t)=y(1,1:t)] (n x n x T array).
E[Y(t) t(X(t)) | Y(1,1:T)=y(1,1:T)] (n x m x T array).
E[Y(t) t(X(t-1)) | Y(1,1:T)=y(1,1:T)] (n x m x T array).
E[Y(t) t(X(t+1)) | Y(1,1:T)=y(1,1:T)] (n x m x T array).
Any error messages due to ill-conditioned matrices.
(TRUE/FALSE) Whether errors were generated.
For state space models, MARSShatyt()
computes the expectations involving Y. If Y is completely observed, this entails simply replacing Y with the observed y. When Y is only partially observed, the expectation involves the conditional expectation of a multivariate normal.
Holmes, E. E. (2012) Derivation of the EM algorithm for constrained and unconstrained multivariate autoregressive state-space (MARSS) models. Technical report. arXiv:1302.3919 [stat.ME] Type RShowDoc("EMDerivation",package="MARSS")
to open a copy. See the section on 'Computing the expectations in the update equations' and the subsections on expectations involving Y.
# NOT RUN {
dat <- t(harborSeal)
dat <- dat[2:3, ]
MLEobj <- MARSS(dat)
EyList <- MARSShatyt(MLEobj)
# }
Run the code above in your browser using DataLab