powered by
Function sim_smoother performs simulation smoothing i.e. simulates the states from the conditional distribution \(p(\alpha | y, \theta)\).
sim_smoother
sim_smoother(model, nsim, seed, use_antithetic = FALSE, ...)# S3 method for gaussian sim_smoother( model, nsim = 1, seed = sample(.Machine$integer.max, size = 1), use_antithetic = FALSE, ... )# S3 method for nongaussian sim_smoother( model, nsim = 1, seed = sample(.Machine$integer.max, size = 1), use_antithetic = FALSE, ... )
# S3 method for gaussian sim_smoother( model, nsim = 1, seed = sample(.Machine$integer.max, size = 1), use_antithetic = FALSE, ... )
# S3 method for nongaussian sim_smoother( model, nsim = 1, seed = sample(.Machine$integer.max, size = 1), use_antithetic = FALSE, ... )
Model object.
Number of independent samples.
Seed for the random number generator.
Use an antithetic variable for location. Default is FALSE. Ignored for multivariate models.
FALSE
Ignored.
An array containing the generated samples.
For non-Gaussian/non-linear models, the simulation is based on the approximating Gaussian model.
# NOT RUN { model <- bsm_lg(rep(NA, 50), sd_level = uniform(1,0,5), sd_y = uniform(1,0,5)) sim <- sim_smoother(model, 12) ts.plot(sim[, 1, ]) # }
Run the code above in your browser using DataLab