mixVAR_sim | R Documentation |
Simulate data from multivariate MixAR models under the assumptions of multivariate Gaussian innovarion
mixVAR_sim(model, n, init, nskip = 100, flag = FALSE)
model |
model from which to simulate, an object inheriting from class
|
n |
size of simulated multivariate series. |
init |
initial values, a numeric matrix. If |
nskip |
number of burn-in values. |
flag |
if |
mixVAR_sim simulates a series of length nskip + n
and returns
the last n
values. init
provides initial values for the
algorithm. Each row is considered as a time point. The number of rows
must be at least equal to the maximal AR order.
a numeric matrix
with n
rows.
Davide Ravagli
mixAR_sim
AR <- list()
AR[[1]] <- array(c(0.5,-0.3,-0.6,0,0,0.5,0.4,0.5,-0.3), dim = c(3,3,1))
AR[[2]] <- array(c(-0.5,0.3,0,1,0,-0.5,-0.4,-0.2, 0.5), dim = c(3,3,1))
prob <- c(0.75, 0.25)
shift <- cbind(c(0,0,0), c(0,0,0))
Sigma1 <- cbind(c(1, 0.5, -0.4), c(0.5, 2, 0.8), c(-0.4, 0.8, 4))
Sigma2 <- cbind(c(1,0.2, 0), c(0.2, 2, -0.15), c(0, -0.15, 4))
Sigma <- array(c(Sigma1, Sigma2), dim = c(3,3,2))
m <- new("MixVARGaussian", prob=prob, vcov=Sigma, arcoef=AR, shift=shift)
mixVAR_sim(m, n=500, init=matrix(rep(0,3), ncol=3), nskip=100, flag=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.