kfilter | R Documentation |

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*.

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

`model` |
Model of class |

`...` |
Ignored. |

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

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`

up to the time point n+1 where n is the
length of the input time series.

`bootstrap_filter`

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)

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.