if (FALSE) {
### Small example ###
# Simulate data:
Model <- mlVARsim(nPerson = 100, nNode = 3, nTime = 50, lag=1)
# Estimate using correlated random effects:
fit <- mlVAR(Model$Data, vars = Model$vars,
idvar = Model$idvar, lags = 1,
temporal = "correlated")
# Sample from fitted model:
samples <- mlVARsample(fit, nTime = 50, nSample = 50, pMissing = 0.1,
nReps = 5, nCores = 1)
# Summarize results:
summary(samples)
}
Run the code above in your browser using DataLab