Learn R Programming

VARshrink: Shrinkage Estimation Methods for Vector Autoregressive (VAR) Models.

VAR model is a fundamental and effective approach for multivariate time series analysis. Shrinkage estimation methods can be applied to high-dimensional VAR models with dimensionality greater than the number of observations, contrary to the standard ordinary least squares method.

The package VARshrink aims to be an integrative R package delivering nonparametric, parametric, and semiparametric methods in a unified and consistent manner.

The package VARshrink provides a simple interface function VARshrink(), which is an extension of the function VAR() in the vars package.

Installation

The package can be installed conveniently from GitHub:

if (!("devtools" %in% installed.packages())) 
  install.packages("devtools")

devtools::install_github("namgillee/VARshrink")

Example

data(Canada, package = "vars")
y <- diff(Canada)
estim <- VARshrink(y, p = 2, type = "none", method = "ns")
plot(predict(estim), names = "U")

References

N. Lee, H. Choi, and S.-H. Kim (2016). Bayes shrinkage estimation for high-dimensional VAR models with scale mixture of normal distributions for noise. Computational Statistics & Data Analysis 101, 250-276. doi: 10.1016/j.csda.2016.03.007

S. Ni and D. Sun (2005). Bayesian estimates for vector autoregressive models. Journal of Business & Economic Statistics 23(1), 105-117. doi: 10.1198/073500104000000622

R. Opgen-Rhein and K. Strimmer (2007). Learning causal networks from systems biology time course data: an effective model selection procedure for the vector autoregressive process. BMC Bioinformatics 8(2), S3. doi: 10.1186/1471-2105-8-S2-S3.

Copy Link

Version

Install

install.packages('VARshrink')

Monthly Downloads

391

Version

0.3.3

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Namgil Lee

Last Published

January 10th, 2026

Functions in VARshrink (0.3.3)

VARshrink

Shrinkage estimation of VAR parameters
summary.varshrinkest

Summary method for an object of class "varshrinkest", VAR parameters estimated by VARshrink()
summary.shrinklm

Summarizing shrinkage estimates of an AR model
lm_semi_Bayes_PCV

Semiparametric Bayesian Shrinkage Estimation Method for Multivariate Regression
serial.test_sh

Test for serially correlated errors
stability_sh

Structural stability of a VAR(p)
simVARmodel

Generate multivariate time series data using the given VAR model
shrinkVARcoef

Semiparametric Bayesian Shrinkage Estimator for Multivariate Regression
logLik.varshrinkest

Log-likelihood method for class "varshrinkest"
irf.varshrinkest

Impulse response function
Phi.varshrinkest

Coefficient matrices of the MA represention
calcSSE_Acoef

Sum of squared errors (SSE) between coefficients of two VARs
Acoef_sh

Coefficient matrices of the lagged endogenous variables
lm_ShVAR_KCV

K-fold Cross Validation for Selection of Shrinkage Parameters of Semiparametric Bayesian Shrinkage Estimator for Multivariate Regression
convPsi2varresult

Convert format for VAR coefficients from Psi to varresult
Bcoef_sh

Coefficient matrix of an estimated VAR(p)
causality_sh

Causality Analysis
createVARCoefs_ltriangular

Create coefficients of a VAR model
restrict_sh

Restricted VAR
roots_sh

Eigenvalues of the companion coefficient matrix of a VAR(p)
print.varshrinkest

Print method for class "varshrinkest"
print.varshsum

Print method for class "varshsum"
lm_multiv_ridge

Multivariate Ridge Regression
lm_full_Bayes_SR

Full Bayesian Shrinkage Estimation Method for Multivariate Regression