## simulate a Garch(1,1) time series
x <- garchSim(n = 200)
head(x)
## fit GARCH(1,1) model
fit <- garchFit(formula = ~ garch(1, 1), data = x, trace = FALSE)
if (FALSE) {
## choose plots interactively
plot(fit)
}
## Batch Plot:
plot(fit, which = 3)
## a 2 by 2 matrix of plots
op <- par(mfrow = c(2,2)) # prepare 2x2 window
plot(fit, which = c(10, 11, 3, 16)) # plot
par(op) # restore the previous layout
Run the code above in your browser using DataLab