Learn R Programming

TSA (version 0.99)

garch.sim: Simulate a GARCH process

Description

Simulate a GARCH process.

Usage

garch.sim(alpha, beta, n = 100, rnd = rnorm, ntrans = 100,...)

Arguments

alpha
The vector of ARCH coefficients including the intercept term as the first element
beta
The vector of GARCH coefficients
n
sample size
rnd
random number generator for the noise; default is normal
ntrans
burn-in size, i.e. number of initial simulated data to be discarded
...
parameters to be passed to the random number generator

Value

  • simulated GARCH time series of size n.

Details

Simulate data from the GARCH(p,q) model: $x_t=\sigma_{t|t-1} e_t$ where ${e_t}$ is iid, $e_t$ independent of past $x_{t-s}, s=1,2,\ldots$, and $$\sigma_{t|t-1}=\sum_{j=1}^p \beta_j \sigma_{t-j|t-j-1}+ \alpha_0+\sum_{j=1}^q \alpha_j x_{t-i}^2$$

Examples

Run this code
set.seed(1235678)
garch01.sim=garch.sim(alpha=c(.01,.9),n=500)
plot(garch01.sim,type='l', main='',ylab=expression(r[t]),xlab='t')

Run the code above in your browser using DataLab