mtar_grid: Bayesian Estimation of Multivariate TAR Models

View source: R/wrapperfunctions.R

mtar_gridR Documentation

Bayesian Estimation of Multivariate TAR Models

Description

This function is a wrapper that applies mtar() over a grid of model specifications defined by all combinations of the noise distribution (dist), the number of regimes (from nregim.min to nregim.max), the autoregressive order within each regime (from p.min to p.max), the maximum lag of the exogenous series within each regime (from q.min to q.max), and the maximum lag of the threshold series within each regime (from d.min to d.max). In all calls to mtar(), the same set of time points is used for model fitting. This is achieved by appropriately adjusting the subset argument of mtar() for each model specification, thereby ensuring comparability across models.

Usage

mtar_grid(
  formula,
  data,
  subset,
  Intercept = TRUE,
  trend = c("none", "linear", "quadratic"),
  nseason = NULL,
  nregim.min = 1,
  nregim.max = NULL,
  p.min = 1,
  p.max = NULL,
  q.min = 0,
  q.max = 0,
  d.min = 0,
  d.max = 0,
  row.names,
  dist = "Gaussian",
  prior = list(),
  n.sim = 500,
  n.burnin = 100,
  n.thin = 1,
  ssvs = FALSE,
  setar = NULL,
  plan_strategy = c("sequential", "multisession"),
  progress = TRUE
)

Arguments

formula

A three-part expression of class Formula describing the TAR model to be fitted. The first part specifies the variables in the multivariate output series, the second part defines the threshold series, and the third part specifies the variables in the multivariate exogenous series.

data

A data frame containing the variables in the model. If not found in data, the variables are taken from environment(formula), typically the environment from which mtar_grid() is called.

subset

An optional vector specifying a subset of observations to be used in the fitting process.

Intercept

An optional logical indicating whether an intercept should be included within each regime.

trend

An optional character string specifying the degree of deterministic time trend to be included in each regime. Available options are "linear", "quadratic", and "none". By default, trend is set to "none".

nseason

An optional integer, greater than or equal to 2, specifying the number of seasonal periods. When provided, nseason - 1 seasonal dummy variables are added to the regressors within each regime. By default, nseason is set to NULL, thereby indicating that the TAR model has no seasonal effects.

nregim.min

An optional integer specifying the minimum number of regimes. By default, nregim.min is set to 1.

nregim.max

An integer specifying the maximum number of regimes.

p.min

An optional integer specifying the minimum autoregressive order within each regime. By default, p.min is set to 1.

p.max

An integer specifying the maximum autoregressive order within each regime.

q.min

An optional integer specifying the minimum value of the maximum lag of the exogenous series within each regime. By default, q.min is set to 0.

q.max

An optional integer specifying the maximum value of the maximum lag of the exogenous series within each regime. By default, q.max is set to 0.

d.min

An optional integer specifying the minimum value of the maximum lag of the threshold series within each regime. By default, d.min is set to 0.

d.max

An optional integer specifying the maximum value of the maximum lag of the threshold series within each regime. By default, d.max is set to 0.

row.names

An optional variable in data labelling the time points corresponding to each row of the data set.

dist

A character vector specifying the multivariate distributions used to model the noise process. Available options are "Gaussian", "Student-t", "Slash", "Hyperbolic", "Laplace", "Contaminated normal", "Skew-normal", and "Skew-Student-t". By default, dist is set to "Gaussian".

prior

An optional list specifying the hyperparameter values that define the prior distribution. This list can be validated using the priors() function. By default, prior is set to an empty list, thereby indicating that the hyperparameter values should be set so that a non-informative prior distribution is obtained.

n.sim

An optional positive integer specifying the number of simulation iterations after the burn-in period. By default, n.sim is set to 500.

n.burnin

An optional positive integer specifying the number of burn-in iterations. By default, n.burnin is set to 100.

n.thin

An optional positive integer specifying the thinning interval. By default, n.thin is set to 1.

ssvs

An optional logical indicating whether the Stochastic Search Variable Selection (SSVS) procedure should be applied to identify relevant lags of the output, exogenous, and threshold series. By default, ssvs is set to FALSE.

setar

An optional positive integer indicating the component of the output series used as the threshold variable. By default, setar is set to NULL, indicating that the fitted model is not a SETAR model.

plan_strategy

An optional character string specifying the execution strategy for parallel computation. Available options are "sequential" and "multisession". By default, plan_strategy is set to "sequential".

progress

An optional logical indicating whether a progress bar should be displayed during execution. By default, progress is set to TRUE.

Value

A list whose elements are objects of class mtar, each corresponding to a distinct model specification considered in the grid.

See Also

mtar


mtarm documentation built on Jan. 12, 2026, 1:07 a.m.

Related to mtar_grid in mtarm...