Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

kfilter

Kalman Filtering


Description

Function kfilter runs the Kalman filter for the given model, and returns the filtered estimates and one-step-ahead predictions of the states α_t given the data up to time t.

Usage

kfilter(model, ...)

## S3 method for class 'gaussian'
kfilter(model, ...)

## S3 method for class 'nongaussian'
kfilter(model, ...)

Arguments

model

Model Model object.

...

Ignored.

Details

For non-Gaussian models, the filtering is based on the approximate Gaussian model.

Value

List containing the log-likelihood (approximate in non-Gaussian case), one-step-ahead predictions at and filtered estimates att of states, and the corresponding variances Pt and Ptt.

See Also

Examples

x <- cumsum(rnorm(20))
y <- x + rnorm(20, sd = 0.1)
model <- bsm_lg(y, sd_level = 1, sd_y = 0.1)
ts.plot(cbind(y, x, kfilter(model)$att), col = 1:3)

bssm

Bayesian Inference of Non-Linear and Non-Gaussian State Space Models

v1.1.4
GPL (>= 2)
Authors
Jouni Helske [aut, cre] (<https://orcid.org/0000-0001-7130-793X>), Matti Vihola [aut] (<https://orcid.org/0000-0002-8041-7222>)
Initial release
2021-04-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.