simulate.tsgarch.spec {tsgarch} | R Documentation |
Model Simulation
Description
Simulates paths of a GARCH model.
Usage
## S3 method for class 'tsgarch.spec'
simulate(
object,
nsim = 1,
seed = NULL,
h = 1000,
var_init = NULL,
innov = NULL,
innov_init = NULL,
vreg = NULL,
burn = 0,
...
)
Arguments
object |
an object of class “tsgarch.spec”. |
nsim |
the number of sample paths to generate. |
seed |
an integer that will be used in a call to set.seed before simulating. |
h |
the number of time steps to simulate paths for. |
var_init |
the seed value for initializing the variance equation recursion. If NULL, the variance target value is used based on the supplied parameters. This should be a vector and assumes all sample paths are seeded the same way. |
innov |
an optional matrix of dimensions nsim by h of zero mean unit variance (standardized) innovations which will be used instead of the model distribution for simulation. No checks are performed on whether the supplied values are standardized. |
innov_init |
an optional vector of initialization values for the standardized innovations. This allows the seeding of the initial innovations with user supplied values (useful when simulating forward from an existing model for the purpose of continuing the modeled series from some fixed point). |
vreg |
an optional vector of length h representing any pre-multiplied variance regressors to use in the simulation. |
burn |
burn in. Will be discarded before returning the output. |
... |
for aparch, fgarch, egarch and gjrgarch models, an optional vector of length max(q,p) with values for initializing the ARCH equation and named “arch_initial”. This is mostly used for validation purposes. The “arch_initial” value is always returned by an estimated object. |
Details
Once a GARCH model is specified via garch_modelspec
,
the slot “parmatrix” contains initial values for the parameters
which can be used to set them to any value for the simulation. This matrix
as well as details of the model (type, order, distribution) are the only
pieces of information used in the simulation. The “vreg” argument in
the spec will be ignored. Instead, the user can supply a pre-multiplied vector
to the simulate function which will be used. Note that the “multiplicative”
argument in the specification will be used in this case to determine how the
regressors enter the conditional variance equation. While the “innov”
argument must be a matrix, all other values are vectors and assume that they
will be the same across all sample paths. If the user wants to assign different values
for arguments “var_init”, “innov_init” and “vreg”, then
the simulate method should be called multiple times.
Value
An object of class “tsgarch.simulate” with slots for the simulated sigma and series simulated distributions which are each of class “tsmodel.distribution”. The simulated error (not returned) is equal to the simulated series less the mean equation constant if not equal to zero.