smoother: Kalman smoother for Gaussian state space model

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

Description

Based on the output from kfilter, this function runs the Kalman smoother to produce the conditional means and variances of the state vectors given all observations.

Usage

1

Arguments

ss

object of class SS, where the components m and C have been set by the kfilter.

Details

The Kalman smoother yields the distribution

(θ_t|y[,1:n]) ~ N(m*_t, C*_t)

through the backward recursion for t=n..1,

R_{t+1}= G_{t+1} C_t G_{t+1}^T + W_{t+1}

B_t = C_t G_{t+1}^T R_{t+1}^{-1}

m*_t = m_t + B_t ( m*_{t+1} - G_{t+1} m_t)

C*_t = C_t + B_t ( C*_{t+1} - R_{t+1} ) B_t^T

where the matrices F, G, V, W are stored in the SS object as functions, eg. Fmat(tt,x,phi), see SS. The vectors m and matrices C are set by the kfilter and are overwritten by the Kalman smoother.

The smoother also calculates the signal, μ_t = F^T_t m*_t.

Value

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

Author(s)

Claus Dethlefsen and Søren Lundbye-Christensen.

See Also

SS, kfilter

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.s <- smoother(kfilter(m1))
plot(m1$y)
lines(m1.s$m,lty=2)

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