Description Usage Arguments Details Value References
Performs Kalman filtering and smoothing with exact diffuse initialization using univariate approach for exponential family state space models. For non-Gaussian models, state smoothing is provided with additional smoothed mean and variance of observations.
1 2 3 4 |
object |
Object of class |
smoothing |
Perform state or disturbance smoothing
or both. Default is |
simplify |
If FALSE, KFS returns some generally not so interesting variables from filtering and smoothing. Default is TRUE. |
transform |
How to transform the model in case of
non-diagonal covariance matrix H. Defaults to
|
nsim |
Number of independent samples. Default is 100. Only used for non-Gaussian model. |
theta |
Initial values for conditional mode theta.
Default is |
maxiter |
Maximum number of iterations used in linearisation. Default is 100. Only used for non-Gaussian model. |
Notice that in case of multivariate observations,
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 tolF
to smaller (or larger)
should help.
For Gaussian model, a list with the following components:
model |
Original state space model. |
KFS.transform |
Type of H after possible transformation. |
logLik |
Value of the log-likelihood function. |
a |
One step predictions of states, a[t]=E(α[t] | y[t-1], … , y[1]). |
P |
Covariance matrices of predicted states, P[t]=Cov(α[t] | y[t-1], … , y[1]). |
Pinf |
Diffuse part of P[t]. |
v |
Prediction errors v[i,t] = y[i,t] - Z[i,t]a[i,t], i=1,…,p, where a[i,t]=E(α[t] | y[i-1,t], …, y[1,t], … , y[1,1]). |
F |
Prediction error variances Var(v[t]). |
Finf |
Diffuse part of F[t]. |
d |
The last index of diffuse phase, i.e. the non-diffuse phase began from time d+1. |
j |
The index of last y_{i,t} of diffuse phase. |
alphahat |
Smoothed estimates of
states, E(α[t]
| y[1], … , y[n]). Only computed if
|
V |
Covariances Var(α[t] | y[1], … , y[n]). Only
computed if |
etahat |
Smoothed
disturbance terms E(η[t] | y[1], … , y[n]).Only computed if
|
V_eta |
Covariances
Var(η[t] | y[1],
… , y[n]). Only computed if
|
epshat |
Smoothed disturbance terms
E(ε[t] |
y[1], … , y[n]). Only computed if
|
V_eps |
Diagonal elements
of Var(ε[t] | y[1], … , y[n]). Note that
due to the diagonalization, off-diagonal elements are
zero. Only computed if |
In addition, if argument
simplify=FALSE
, list contains following
components:
K |
Covariances Cov(α[t,i], y[t,i] | y[i-1,t], …, y[1,t], y[t-1], … , y[1]), i=1,…,p. |
Kinf |
Diffuse part of K[t]. |
r |
Weighted sums of innovations v[t+1], … , v[n]. Notice that in literature t in r[t] goes from 0, …, n. Here t=1, …, n+1. Same applies to all r and N variables. |
r0,
r1 |
Diffuse phase decomposition of r[t]. |
N |
Covariances Var(r[t]) . |
N0, N1, N2 |
Diffuse phase decomposition of N[t]. |
For non-Gaussian model, a list with the following components:
model |
Original state space model with
additional elements from function |
alphahat |
Smoothed estimates of states E(α[t] | y[1], … , y[n]). |
V |
Covariances Var(α[t] | y[1], … , y[n]). |
yhat |
A time series object containing smoothed means of observation distributions, with parameter u[t]exp(thetahat[t]) for Poisson and u[t]exp(thetahat[t])/(1+exp(thetahat[t]). |
V.yhat |
a vector of length containing smoothed variances of observation distributions. |
Koopman, S.J. and Durbin J. (2000). Fast filtering and
smoothing for non-stationary time series models, Journal
of American Statistical Assosiation, 92, 1630-38.
Koopman, S.J. and Durbin J. (2001). Time Series Analysis
by State Space Methods. Oxford: Oxford University Press.
Koopman, S.J. and Durbin J. (2003). Filtering and
smoothing of state vector for diffuse state space models,
Journal of Time Series Analysis, Vol. 24, No. 1.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.