# NOT RUN {
library(mAr)
p <- 3
n <- 1e3
omega <- 5*diag(1,p)
## Making correlation matrix var(1) model
set.seed(100)
foo <- matrix(rnorm(p^2), nrow = p)
foo <- foo %*% t(foo)
phi <- foo / (max(eigen(foo)$values) + 1)
out <- as.matrix(mAr.sim(rep(0,p), phi, omega, N = n))
mcse.bm <- mcse.multi(x = out)
mcse.tuk <- mcse.multi(x = out, method = "tukey")
# If we are only estimating the mean of the first component,
# and the second moment of the second component
g <- function(x) return(c(x[1], x[2]^2))
mcse <- mcse.multi(x = out, g = g)
# }
Run the code above in your browser using DataLab