Learn R Programming

fEGarch (version 1.0.1)

fEGarch_sim: Simulate From Models of the Broader EGARCH Family

Description

A streamlined simulation function to simulate from models that are part of the broader EGARCH family specifiable through fEGarch_spec.

Usage

fEGarch_sim(
  spec = egarch_spec(),
  pars = list(mu = 0, ar = numeric(0), ma = numeric(0), D = 0, omega_sig = -9, phi = 0.8,
    psi = numeric(0), kappa = -0.2, gamma = 0.3, d = 0, df = 10, shape = 2, P = 3, skew =
    1),
  n = 1000,
  nstart = 5000,
  trunc = "none"
)

Value

A list with four elements is returned: rt are the simulated observations, etat are the underlying innovations, sigt are the correspondingly simulated conditional standard deviations, and cmeans are the simulated conditional means. These four elements are formatted as "ts" class time series objects.

Arguments

spec

an object of class "egarch_type_spec" or "loggarch_type_spec" returned by fEGarch_spec or related wrapper functions; note that the model orders in the conditional mean and in the conditional variance as well as the long-memory settings are not controlled through the element orders and long_memo of spec but solely through the parameter settings in pars.

pars

a named list with the parameter specifications; the user can provide a named list with only the settings they would like to adjust relative to the default settings.

n

the number of observations to return.

nstart

the number of burn-in observations to simulate before the final n values to keep; the first nstart values are not returned; if a dual model, i.e. with model in the conditional mean and in the conditional variance, is considered, two times nstart is considered in the first simulation step in the conditional variance, so that n + nstart values can be fed into the second simulation step for the conditional mean.

trunc

a truncation for the finite-order coefficient series in long-memory models; can either be the character "none" for truncation back to the very first observation at each time point, or to any positive integer for setting the corresponding truncation length of the infinite-order representation polynomial.

Details

See the documentation on fEGarch_spec for information on the models of the broader EGARCH family. This function provides an easy way to simulate from these models.

Examples

Run this code
spec <- megarch_spec()
sim <- fEGarch_sim(spec = spec)
mat <- do.call(cbind, sim)
plot(mat, main = "")

Run the code above in your browser using DataLab