mlVARcompare | R Documentation |
This function compares the fit of several mlVAR models. Since an mlVAR model is a combination of univariate models this function will compare the fits for each univariate model.
mlVARcompare(...)
... |
Any number of objects obtained from |
Important to note is that the number of observations must be equal to make models comparable. If the lags are different and compareToLags
was not used in mlVAR
this function will stop with an informative error message.
Sacha Epskamp (mail@sachaepskamp.com)
## Not run:
### Small example ###
# Simulate data:
Model <- mlVARsim(nPerson = 50, nNode = 3, nTime = 50, lag=1)
# Estimate using different methods:
fit1 <- mlVAR(Model$Data, vars = Model$vars, idvar = Model$idvar, lags = 1,
temporal = "correlated")
fit2 <- mlVAR(Model$Data, vars = Model$vars, idvar = Model$idvar, lags = 1,
temporal = "orthogonal")
fit3 <- mlVAR(Model$Data, vars = Model$vars, idvar = Model$idvar, lags = 1,
temporal = "fixed")
# Compare models:
mlVARcompare(fit1,fit2,fit3)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.