garch.sim: Simulate a GARCH process

Description Usage Arguments Details Value Author(s) Examples

View source: R/garch.sim.R

Description

Simulate a GARCH process.

Usage

1
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

Details

Simulate data from the GARCH(p,q) model: x_t=σ_{t|t-1} e_t where \{e_t\} is iid, e_t independent of past x_{t-s}, s=1,2,…, and

σ_{t|t-1}=∑_{j=1}^p β_j σ_{t-j|t-j-1}+ α_0+∑_{j=1}^q α_j x_{t-i}^2

Value

simulated GARCH time series of size n.

Author(s)

Kung-Sik Chan

Examples

1
2
3
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')

Example output

Loading required package: leaps
Loading required package: locfit
locfit 1.5-9.1 	 2013-03-22
Loading required package: mgcv
Loading required package: nlme
This is mgcv 1.8-17. For overview type 'help("mgcv-package")'.
Loading required package: tseries

Attaching package: 'TSA'

The following objects are masked from 'package:stats':

    acf, arima

The following object is masked from 'package:utils':

    tar

TSA documentation built on July 2, 2018, 1:04 a.m.