VPSPulse Mirrors

High-Performance Open-Source Archive

README

mtarm: Multivariate Threshold Autoregressive (TAR) models

Overview

mtarm is an R package for Bayesian estimation, inference, model comparison, and forecasting in multivariate Threshold Autoregressive (TAR) models. The package supports multiple innovation distributions, automatic variable selection through Stochastic Search Variable Selection (SSVS), and both standard forecasting and rolling-origin forecast evaluation. The package accommodates multivariate TAR models with exogenous variables and allows for flexible error specifications, including Gaussian, Student-\(t\), skew-normal, skew-Student-\(t\), Laplace, slash, contaminated normal, and symmetric hyperbolic distributions.

Installation

Install the development version from GitHub:

remotes::install_github("lhvanegasp/mtarm")

Load the package:

library(mtarm)

Main Features

Quick Start

The following example illustrates how a \(\text{TAR}(3;p=(1,1,2))\) Student-\(t\) model can be fitted on a bivariate output series:

library(mtarm)

data(returns)
fit <- mtar(~ COLCAP + BOVESPA | SP500, data=returns, row.names=Date,
            subset={Date<="2015-12-07"}, dist="Student-t",
            ars=ars(nregim=3,p=c(1,1,2)), n.burnin=1000, n.sim=2000,
            n.thin=2)

summary(fit)

Generate forecasts:

newdata <- subset(returns, Date>"2015-12-07")
pred <- predict(fit, newdata=newdata, n.ahead=nrow(newdata), credible=0.95)

pred[["summary"]]

Documentation

Additional examples and detailed explanations are available in the package website:

https://lhvanegasp.github.io/mtarm/

Reference manual:

https://lhvanegasp.github.io/mtarm/reference/

Articles and vignettes:

https://lhvanegasp.github.io/mtarm/articles/

Reproducibility

For reproducible analyses, users are encouraged to set a random seed before model estimation:

set.seed(6666)

All examples included in the documentation website and package vignettes can be reproduced directly from the source code distributed with the package.

Citation

If you use mtarm in academic work, please cite the corresponding package paper:

Vanegas, L. H., et al. mtarm: Bayesian Multivariate Threshold Autoregressive Models in R.

Need mirroring services?
Contact our team at info@vpspulse.com.

Mirror powered by VPSpulse

Infrastructure sponsored by VPSPulse & Secure Payments by ArionPay.