plot,yuima.kalmanBucyFilter,ANY-method | R Documentation |
Plotting method for objects of class yuima.kalmanBucyFilter
.
## S4 method for signature 'yuima.kalmanBucyFilter,ANY'
plot(x, plot_truth = FALSE, level = 0)
x |
A |
plot_truth |
Logical. If |
level |
Numeric. If 0 < |
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.
NULL (plot is drawn)
The YUIMA Project Team
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.