kfs {sspir}R Documentation

(Iterated extended) Kalman smoother

Description

Runs the Kalman smoother on an ssm object if the family-attribute of the object is gaussian. If not, the iterated extended Kalman smoother is used.

Usage

kfs(ss, ...)

Arguments

ss an object of class ssm.
... further arguments passed to the Kalman smoother.

Details

The function is a wrapper for kfilter followed by smoother in the Gaussian case. For other family types, extended is called.

Value

The returned value from either smoother (Gaussian case) or extended.

Author(s)

Claus Dethlefsen and Søren Lundbye-Christensen.

See Also

kfilter, smoother, extended, ssm.

Examples

data(mumpsdat)
time <- 1:nrow(mumpsdat)
m3 <- ssm( mumps ~ -1 + tvar(polytime(time,1)) +
                  tvar(polytrig(time,12,1)),
                  family=poisson(link=log),time=time,data=mumpsdat) 
m3$ss$phi["epsilon"] <- 0
m3$ss$phi["polytime(time, 1)time0"] <- 0
m3$ss$phi["polytime(time, 1)time1"] <- 0.0005
m3$ss$phi["polytrig(time,12,1)"] <- 0.0001
diag(m3$ss$C0) <- 1

m3.fit <- kfs(m3)

[Package sspir version 0.1.0 Index]