KFS(model, filtering, smoothing, simplify = TRUE, transform = c("ldl",
"augment"), nsim = 0, theta, maxiter = 25)
SSModel
.'ldl'
. See function transformSSM
for
details.approxSSM
and performs the usual Gaussian smoothing so that KFS
returns depends on the arguments
filtering
, smoothed
and simplify
, and
whether the model is Gaussian or not:nsim=0
, only diagonal elements
(variances) are computed, using the delta method.nsim=0
, only diagonal elements (variances) are
computed, using the delta method.simplify=FALSE
, list contains following
components:v
,
F
, Finf
, K
and Kinf
are usually
not the same as those calculated in usual multivariate
Kalman filter. As filtering is done one observation element
at the time, the elements of prediction error
$v_t$ are uncorrelated, and F
,
Finf
, K
and Kinf
contain only the
diagonal elemens of the corresponding covariance matrices.
In rare cases of a very long diffuse initialization phase
with highly correlated states, cumulative rounding errors
in computing Finf
and Pinf
can sometimes
cause the diffuse phase end too early. Changing the
tolerance parameter tol
of the model (see
SSModel
) to smaller (or larger) should help.
In case of non-Gaussian models with nsim=0
, the
smoothed estimates relate the conditional mode of
$p(\alpha|y)$, and are equivalent with the results from
generalized linear models. When using importance sampling
(nsim>0
), results correspond to the conditional
mean.