Description Usage Arguments Examples
View source: R/dgp__rmixmorm.R
For more information see dmixnorm()
1 | dmixnorm.ts(y, means.ar.par.list, sigmas.list, weights, log = FALSE)
|
y |
An 'n'-length vector. The time series. |
means.ar.par.list |
A 'k'-length list. Each element in the list consists the coefficients in the AR process. |
sigmas.list |
A 'k'-length lilst. |
weights |
A 'k'-length vector. The weight in each component. |
log |
Logical; If TRUE, the log density is returned. |
1 2 3 4 5 6 7 8 9 10 11 12 13 | n = 1000
means.ar.par.list = list(c(0, 0.8), c(0, 0.6, 0.3))
require("mvtnorm")
require("fGarch")
sigmas.spec <- list(garchSpec(model = list(alpha = c(0.05, 0.06)), cond.dist = "norm"),
garchSpec(model = list(alpha = c(0.05, 0.05)), cond.dist = "norm"))
sigmas.list <- lapply(lapply(sigmas.spec, 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)
out = dmixnorm.ts(y = y, means.ar.par.list = means.ar.par.list,
sigmas.list = sigmas.list, weights = weights, log = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.