knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-"
)

The tVAR package allows R users to estimate the penalized Vector AutoRegression model with t-distributed innovations (t-VAR) proposed in Barbaglia et al. (2020). The package allows to compute the resulting volatility spillovers and visualize them via networks.

Installation

You can install tVAR from GitHub as follows:

install.packages("devtools")
devtools::install_github("lucabarbaglia/t-VAR")

Fit a t-VAR with estimated of the degrees of freedom

Fit a penalized t-VAR of order P=2 on the RV data set containing the log-transformed realized volatilities for J=5 stocks and N=500 observations.

library(tVAR)
data(RV)
DATA <- as.matrix(RV)
fit <- Large.tVAR(Data=DATA, P=2, lambda1_OPT = 5, gamma1_OPT = 0.2) 
str(fit, max.level = 1)

The output of the Large.tVAR function is a list containing, among other ones, the following objects:

If you do not wish to specify the magnitude of the penalization, you select it via BIC by setting the paramaters lambda1_min, lambda1_max, lambda1_steps. If you do not wish to estimate the degrees-of-freedom of the multivariate t distribution of the VAR innovations, you can use the EM_VAR function.

Volatilty spillover networks

Build the volatility spillovers from the t-VAR estimation.

# Volatility Spillovers:
vs <- Spillovers(fit = fit)
vs$spill_index      # volatility spillover index

# volatility spillover matrix
spills <- vs$spill
colnames(spills) <- rownames(spills) <- colnames(RV)
round(spills,2)

Plot the network of volatility spillovers.

# Volatility spillover network:
network.vs(spill=round(spills))

References:



lucabarbaglia/t-VAR documentation built on Feb. 27, 2021, 3:46 a.m.