kfilter: Kalman filter for Gaussian state space model

Description Usage Arguments Details Value Author(s) See Also Examples

Description

From an SS object, runs the Kalman filter to produce the conditional means and variances of the state vectors given the current time point.

Usage

1
kfilter(ss)

Arguments

ss

object of class SS.

Details

The Kalman filter yields the distribution

(θ_t|y[,1:t]) ~ N(m_t, C_t)

through the recursion for t=1,…,n,

a_t = G_t m_{t-1}

R_t = G_t C_{t-1} G_t^T + W_t

f_t = F_t^T a_t

Q_t = F_t^T R_t F_t + V_t

e_t = y_t - f_t

A_t = R_t F_t Q_t^{-1}

m_t = a_t + A_t e_t

C_t = R_t - A_t Q_t A_t^T

Also, the log-likelihood is calculated.

Value

An object of class SS with the components m, C, and loglik updated.

Author(s)

Claus Dethlefsen and Søren Lundbye-Christensen.

See Also

SS, smoother

Examples

1
2
3
4
5
6
7
8
9
data(kurit)
m1 <- SS(kurit)
phi(m1) <- c(100,5)
m0(m1) <- matrix(130)
C0(m1) <- matrix(400)

m1.f <- kfilter(m1)
plot(m1$y)
lines(m1.f$m,lty=2)

ClausDethlefsen/sspir documentation built on May 6, 2019, 7 p.m.