simulate.MSGARCH_SPEC | R Documentation |
Method for simulating MSGARCH
processes.
## S3 method for class 'MSGARCH_SPEC' simulate( object, nsim = 1L, seed = NULL, nahead = 1L, par = NULL, nburn = 500L, ... ) ## S3 method for class 'MSGARCH_ML_FIT' simulate(object, nsim = 1L, seed = NULL, nahead = 1L, nburn = 500L, ...) ## S3 method for class 'MSGARCH_MCMC_FIT' simulate(object, nsim = 1L, seed = NULL, nahead = 1L, nburn = 500L, ...)
object |
Model specification of class |
nsim |
Number of simulations. (Default: |
seed |
Integer indicating if and how the random number generator should be initialized.
If |
nahead |
Simulation length. (Default: |
par |
Vector (of size d) or matrix (of size |
nburn |
Burnin period discarded (first simulation draws). |
... |
Not used. Other arguments to |
If a matrix of parameters estimates is provided, nsim
simuations will be done for each row.
A list of class MSGARCH_SIM
with the following elements:.
draw
: Matrix (of size nahead
x nsim
) of simulated draws.
state
: Matrix (of size nahead
x nsim
) of simulated states.
CondVol
: Array (of size nahead
x nsim
x K) of simulated conditional volatilities.
The MSGARCH_SIM
class contains the plot
method.
# create specification spec <- CreateSpec() # simulation from specification par <- c(0.1, 0.1, 0.8, 0.2, 0.1, 0.8, 0.99, 0.01) set.seed(1234) sim <- simulate(object = spec, nsim = 1L, nahead = 1000L, nburn = 500L, par = par) head(sim) plot(sim) # load data data("SMI", package = "MSGARCH") # simulation from ML fit fit <- FitML(spec = spec, data = SMI) set.seed(1234) sim <- simulate(object = fit, nsim = 1L, nahead = 1000L, nburn = 500L) head(sim) plot(sim) ## Not run: # simulation from MCMC fit fit <- FitMCMC(spec = spec, data = SMI) set.seed(1234) sim <- simulate(object = fit, nahead = 100L, nburn = 500L) head(sim) plot(sim) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.