lgf1: First order LGF

Description Usage Arguments Value Examples

Description

Given a sparse-spline representation of the observation equation, this function performs filtering to derive the conditional distributions of the filtered (x_{t|t}) and predicted (x_{t|t-1}) hidden states.

Usage

1
lgf1(Y, out.spam, Tt, HHinv, GGt, x0, P0)

Arguments

Y

the observed data, a Nxd matrix

out.spam

the sparse additive spline model associated with the observation equation, as produced by spam

Tt

the state transition matrix, pxp

HHinv

the inverse of the observation noise variance matrix

GGt

the transition noise variance matris

x0

prior mean of the state variables

P0

prior variance of the state variables

Value

A list with components xt and xtt, the predicted and filtered state means respectively and Pt and Ptt, the associated variances.

Examples

1
2
3
4
5
6
someData = generateSPASM(100,3,4)
SPAMfit = spam(someData$y, someData$x)
filt = lgf1(someData$y, SPAMfit, someData$Tt,
  solve(someData$HHt), someData$GGt, rep(0,3), diag(1,3))
matplot(someData$x, ty='l', col=1, lty=1)
matlines(filt$xtt, col=2, lty=3)

dajmcdon/spasm documentation built on May 6, 2019, 1:31 a.m.