KFS: Kalman Filter and Smoother with Exact Diffuse Initialization...

Description Usage Arguments Details Value References

Description

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.

Usage

1
2
3
4
  KFS(object,
    smoothing = c("state", "disturbance", "both", "none"),
    simplify = TRUE, transform = c("ldl", "augment"),
    nsim = 100, theta = NULL, maxiter = 100)

Arguments

object

Object of class SSModel or KFS (in which case only smoothing is performed).

smoothing

Perform state or disturbance smoothing or both. Default is "state" for Gaussian models. For non-Gaussian models, state smoothing is always performed.

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 "ldl". See function transformSSM for details.

nsim

Number of independent samples. Default is 100. Only used for non-Gaussian model.

theta

Initial values for conditional mode theta. Default is log(mean(y/u)) for Poisson and log(mean(y/(u-y))) for Binomial distribution (or log(mean(y)) in case of u[t]-y[t] = 0 for some t). Only used for non-Gaussian model.

maxiter

Maximum number of iterations used in linearisation. Default is 100. Only used for non-Gaussian model.

Details

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.

Value

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 smoothing="state" or smoothing="both".

V

Covariances Var(α[t] | y[1], … , y[n]). Only computed if smoothing="state" or smoothing="both".

etahat

Smoothed disturbance terms E(η[t] | y[1], … , y[n]).Only computed if smoothing="disturbance" or smoothing="both".

V_eta

Covariances Var(η[t] | y[1], … , y[n]). Only computed if smoothing="disturbance" or smooth="both".

epshat

Smoothed disturbance terms E(ε[t] | y[1], … , y[n]). Only computed if smoothing="disturbance" or smoothing="both".

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 smoothing="disturbance" or smoothing="both".

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 approxSSM.

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.

References

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.


jrnold/KFAS documentation built on May 19, 2019, 11:55 p.m.

Related to KFS in jrnold/KFAS...