MyNixOS website logo
Description

Sparse VAR/VECM Models Estimation.

A wrapper for sparse VAR/VECM time series models estimation using penalties like ENET (Elastic Net), SCAD (Smoothly Clipped Absolute Deviation) and MCP (Minimax Concave Penalty). Based on the work of Sumanta Basu and George Michailidis <doi:10.1214/15-AOS1315>.

Sparse VAR (sparsevar)

License Version CRAN_Status_Badge Downloads Total Downloads Build Status

Some R functions useful to estimate sparse VAR / VECM models.

Installation

To install the stable version from CRAN:

install.package("sparsevar")

To install the developing version:

install.packages("devtools")
devtools::install_github("svazzole/sparsevar", "master")

Quick start

To load the sparsevar package simply type

library(sparsevar)

Using the function included in the package, we simply generate a 20x20 VAR(2) process

set.seed(1)
sim <- simulateVAR(N = 20, p = 2)

This command will generate a model with two sparse matrices with 5% of non-zero entries and a Toeplitz variance-covariance matrix with rho = 0.5. We can estimate the matrices of the process using for example

fit <- fitVAR(sim$series, p = 2, threshold = TRUE)

The results can be seen by plotting the two var objects

plotVAR(sim, fit)

the first row of the plot is made by the matrices of the simulated process and the second row is formed by their estimates.

The fit contains also the estimate of the variance/covariance matrix of the residuals

plotMatrix(fit$sigma)

which can be compared with the covariance matrix of the errors of the generating process

plotMatrix(sim$sigma)

Usage

The functions included for model estimation are:

  • fitVAR: to estimate a sparse VAR multivariate time series with ENET, SCAD or MC+;
  • fitVARX: to estimate a sparse VAR-X model using ENET;
  • fitVECM: to estimate a sparse VECM (Vector Error Correction Model) using LS with penalty (again: ENET, SCAD or MC+);
  • impulseResponse: compute the impulse response function;
  • errorBands: estimate the error bands for the IRF (using bootstrap).

For simulations:

  • simulateVAR: to generate a sparse VAR multivariate time series;
  • simulateVARX: to generate a sparse VARX time series;
  • createSparseMatrix: used to create sparse matrices with a given density.

For plotting:

  • plotMatrix: useful to plot matrices and sparse matrices;
  • plotVAR: plot all the matrices of the model or models in input;
  • plotIRF: plot IRF function;
  • plotGridIRF: multiple plots of IRF.

Papers using sparsevar

[1] Gibbons SM, Kearney SM, Smillie CS, Alm EJ (2017) Two dynamic regimes in the human gut microbiome. PLoS Comput. Biol. 13(2): e1005364.

[2] Quentin Guibert, Olivier Lopez, Pierrick Piette, Forecasting mortality rate improvements with a high-dimensional VAR, Insurance: Mathematics and Economics, Volume 88, 2019, Pages 255-272, ISSN 0167-6687.

References

[1] Basu, Sumanta; Michailidis, George. Regularized estimation in sparse high-dimensional time series models. Ann. Statist. 43 (2015), no. 4, 1535--1567. doi:10.1214/15-AOS1315.

[2] Lütkepohl, Helmut. New Introduction to Multiple Time Series Analysis. Springer Science & Business Media, 2005, ISBN 3540277528.

Metadata

Version

0.1.0

License

Unknown

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows