plot-yuima.kalmanBucyFilter-ANY-method: Plotting Method for Kalman-Bucy Filter

plot,yuima.kalmanBucyFilter,ANY-methodR Documentation

Plotting Method for Kalman-Bucy Filter

Description

Plotting method for objects of class yuima.kalmanBucyFilter.

Usage

## S4 method for signature 'yuima.kalmanBucyFilter,ANY'
plot(x, plot_truth = FALSE, level = 0)

Arguments

x

A yuima.kalmanBucyFilter-class object.

plot_truth

Logical. If TRUE, plot true values of state variables.

level

Numeric. If 0 < level < 1, plot confidence interval of level.

Details

This method plots the estimated values of state variables by Kalman-Bucy filter. Optionally, it can plot true values of state variables which may exist when using simulated data. Also, it can plot confidence interval of level if 0 < level < 1.

Value

NULL (plot is drawn)

Author(s)

The YUIMA Project Team

Examples

## Not run: 
# create Kalman-Bucy filter object
drift <- c('a*X', 'c*X')
diffusion <- matrix(
  c('b', '0', '0', 'sigma'),
  2, 2
)
vars <- c('X', 'Y')
mod <- setModel(
  drift = drift, diffusion = diffusion, solve.variable = vars,
  state.variable = vars, observed.variable = 'Y', xinit = c(0, 0)
)
samp <- setSampling(delta = 0.01, n = 10^3)
trueparam <- list(a = -1.5, b = 0.3, c = 1, sigma = 0.02)

### simulate
yuima <- simulate(mod, sampling = samp, true.parameter = trueparam)
res <- kalmanBucyFilter(
  yuima,
  params = trueparam, mean_init = 0, vcov_init = 0.1,
  delta.vcov.solve = 0.001, are = FALSE
)

### visualize
plot(res, plot_truth = TRUE, level = 0.95)

## End(Not run)

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