mixVAR_sim {mixAR} | R Documentation |
Simulate from multivariate MixAR models
Description
Simulate data from multivariate MixAR models under the assumptions of multivariate Gaussian innovarion
Usage
mixVAR_sim(model, n, init, nskip = 100, flag = FALSE)
Arguments
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 |
Details
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.
Value
a numeric matrix
with n
rows.
Author(s)
Davide Ravagli
See Also
Examples
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)
[Package mixAR version 0.22.8 Index]