if (FALSE) { # require("fGarch", quietly = TRUE)
n <- 1000
means.ar.par.list <- list(c(0, 0.8), c(0, 0.6, 0.3))
require("fGarch")
sigmas.spec <- list(
fGarch::garchSpec(model = list(alpha = c(0.05, 0.06)), cond.dist = "norm"),
fGarch::garchSpec(model = list(alpha = c(0.05, 0.05)), cond.dist = "norm")
)
sigmas.list <- lapply(
lapply(sigmas.spec, fGarch::garchSim, extended = TRUE, n = n),
function(x) x$sigma
)
weights <- c(0.8, 0.2)
y <- rmixnorm_ts(
n = n, means.ar.par.list = means.ar.par.list, sigmas.list = sigmas.list,
weights = weights
)
plot(y)
}
Run the code above in your browser using DataLab