Skip to contents

Convenience wrapper around .fitMVAR that optionally selects the model order automatically via mvarOrderSelect.

Usage

mvarFit(
  X,
  order = NULL,
  method = c("ols", "yulewalker", "nuttall-strand"),
  max_order = 20L,
  criterion = c("bic", "aic")
)

Arguments

X

A numeric matrix (time x channels).

order

Integer order, or NULL (default) to select automatically.

method

Estimator (see .fitMVAR).

max_order

Maximum order for automatic selection (default: 20).

criterion

Selection criterion when order is NULL (default "bic").

Value

An object of class "mvar": a list with A, Sigma, order, method, and n_channels.

Examples

set.seed(1)
X <- matrix(rnorm(600), ncol = 3)
fit <- mvarFit(X, order = 2)
dim(fit$A)
#> [1] 3 3 2