RTSsmooth: Rauch–Tung–Striebel Kalman smoothing

Description Usage Arguments Value Examples

View source: R/RTS_smoother.R

Description

RTS kalman filter (smooth) a univariate timeseries with F and H = 1. Simple function to demonstrate kalman smoothing.

Usage

1
RTSsmooth(z, q = 0.5, r = 0.5)

Arguments

z

univariate timeseries (ts) or single vector of values

q

estimated process noise variance (V in StructTS$model)

r

estimated measurement noise variance (h in StructTS$model)

Value

smoothed timeseries.

Examples

1
2
3
4
z <- ts( sin( 2 * pi * 1:200 / 20 ) + rnorm( 200 ), deltat = 1 )
s <- RTSsmooth( z, q = 0.1, r = 1 )
plot( z, type = "l" )
lines( s, col = "red" )

jrevenaugh/TSAUMN documentation built on Nov. 8, 2019, 2:20 p.m.