if(!requireNamespace("tseries")) {
if(interactive() || is.na(Sys.getenv("_R_CHECK_PACKAGE_NAME_", NA))) {
stop("not all packages required for the example are installed")
} else q() }
## returns
data("NYSESW")
ret <- 100 * diff(log(NYSESW))
plot(ret)
## Stock and Watson (2007), p. 667, GARCH(1,1) model
library("tseries")
fm <- garch(coredata(ret))
summary(fm)
Run the code above in your browser using DataLab