rmixnorm_ts | R Documentation |
This function simulates random samples from a finite mixture of Gaussian distribution where the mean from each components are AR(p) process.
rmixnorm_ts(n, means.ar.par.list, sigmas.list, weights, yinit = 0)
n |
number of samples. |
means.ar.par.list |
parameters in AR(p) within each mixing compoment. |
sigmas.list |
variance list. |
weights |
weight in each list. |
yinit |
initial values. |
vector of length n follows a mixture distribution.
Feng Li, Central University of Finance and Economics.
Feng Li, Mattias Villani, and Robert Kohn. (2010). Flexible Modeling of Conditional Distributions using Smooth Mixtures of Asymmetric Student T Densities, Journal of Statistical Planning and Inference, 140(12), pp. 3638-3654.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.