Learn R Programming

fEGarch (version 1.0.1)

fitgarch_sim: Simulate From FITGARCH Models

Description

A streamlined simulation function to simulate from FITGARCH models.

Usage

fitgarch_sim(
  pars = list(mu = 0, ar = numeric(0), ma = numeric(0), D = 0, omega = 4e-04, phi = 0.2,
    beta = 0.4, gamma = 0.1, d = 0.25, df = 10, shape = 2, P = 3, skew = 1),
  cond_dist = c("norm", "std", "ged", "ald", "snorm", "sstd", "sged", "sald"),
  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

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.

cond_dist

a one-element character vector specifying the conditional distribution to consider.

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 fitgarch for information on the FITGARCH model. This function provides an easy way to simulate from these models.

Examples

Run this code
sim <- fitgarch_sim(n = 1000)
mat <- do.call(cbind, sim)
plot(mat, main = "")

Run the code above in your browser using DataLab