##simulate 500 observations w/default parameter values:
set.seed(123)
y <- lgarchSim(500)
##simulate the same series, but with more output:
set.seed(123)
y <- lgarchSim(500, verbose=TRUE)
head(y)
##plot the simulated values:
plot(y)
##simulate from an integrated log-GARCH:
y <- lgarchSim(500, arch=0.1, garch=0.9)
##simulate w/conditioning variable:
x <- rnorm(500)
y <- lgarchSim(500, xreg=0.05*x)
##simulate from a log-GARCH with a simple form of leverage:
z <- rnorm(500)
zneg <- as.numeric(z < 0)
zneglagged <- glag(zneg, pad=TRUE, pad.value=0)
y <- lgarchSim(500, xreg=0.05*zneglagged, innovations=z)Run the code above in your browser using DataLab