kalmanBucyFilter: Kalman-Bucy Filter

View source: R/kalmanBucyFilter.R

kalmanBucyFilterR Documentation

Kalman-Bucy Filter

Description

Estimates values of unobserved variables from observed variables in a Linear State Space Model.

Usage

kalmanBucyFilter(
  yuima, params, mean_init, vcov_init = NULL, delta.vcov.solve = 0.001,
  are = FALSE, explicit = FALSE, time_homogeneous = FALSE,
  env = globalenv()
)

Arguments

yuima

A yuima object. The class of yuima@model must be yuima.linear_state_space_model.

params

A list of numeric values specifying the names and values of the model parameters.

mean_init

A numeric value specifying the initial value of the unobserved variables.

vcov_init

A matrix specifying the initial variance-covariance of the unobserved variables. This argument is required if are = FALSE. If there is only one observed variable, it can be a single numeric value of length 1.

delta.vcov.solve

A numeric value specifying the step size used to solve the mean squared error of the estimator.

are

A logical value. If TRUE, the algebraic Riccati equation is solved.

explicit

A logical value. If TRUE, the filtering equation is solved using the explicit formula. The formula is available only if the coefficients are time-independent.

time_homogeneous

A logical value. If TRUE, calculations are performed under the assumption that the model coefficients are independent of time, reducing computational effort. This flag is used only if are = FALSE.

env

An environment object specifying the environment in which the model coefficients are evaluated.

Value

A yuima.kalmanBucyFilter object.

model

A yuima.linear_state_space_model object.

mean

A ts object containing the estimated values of unobserved variables.

vcov

An array object containing the estimated mean squared error of the estimator of unobserved variables.

mean.init

A numeric value representing the initial value of unobserved variables.

vcov.init

A matrix representing the initial mean squared error of the estimator of unobserved variables.

delta

A numeric value representing the time step of observations.

data

A yuima.data object.

Author(s)

YUIMA TEAM

References

Liptser, R. S., & Shiryaev, A. N. (2001). Statistics of Random Processes: General Theory. Springer.

Examples

vcov_init <- matrix(0.1)
mean_init <- 0
a <- 1.5
b <- 0.3
c <- 1
sigma <- 0.02

n <- 10^4
h <- 0.001

trueparam <- list(a = a, b = b, c = c, sigma = sigma)
mod <- setModel(drift = c("-a*X", "c*X"),
                diffusion = matrix(c("b", "0", "0", "sigma"), 2, 2),
                solve.variable = c("X", "Y"), state.variable = c("X", "Y"),
                observed.variable = "Y")

samp <- setSampling(delta = h, n = n)
yuima <- simulate(mod, sampling = samp, true.parameter = trueparam)

res <- kalmanBucyFilter(
  yuima, trueparam, mean_init, vcov_init, 0.001,
  are = FALSE, env = globalenv()
)

# vcov and mean slots are accesible by mean and vcov method
mean(res)
vcov(res)

yuima documentation built on April 16, 2025, 5:12 p.m.