| Title: | Shrinkage Estimation Methods for Vector Autoregressive Models |
|---|---|
| Description: | Vector autoregressive (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. This package is an integrative package delivering nonparametric, parametric, and semiparametric methods in a unified and consistent manner, such as the multivariate ridge regression in Golub, Heath, and Wahba (1979) <doi:10.2307/1268518>, a James-Stein type nonparametric shrinkage method in Opgen-Rhein and Strimmer (2007) <doi:10.1186/1471-2105-8-S2-S3>, and Bayesian estimation methods using noninformative and informative priors in Lee, Choi, and S.-H. Kim (2016) <doi:10.1016/j.csda.2016.03.007> and Ni and Sun (2005) <doi:10.1198/073500104000000622>. |
| Authors: | Namgil Lee [aut, cre, cph] (ORCID: <https://orcid.org/0000-0003-0593-9028>), Heon Young Yang [ctb], Sung-Ho Kim [aut, cph] |
| Maintainer: | Namgil Lee <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.4.0 |
| Built: | 2026-05-31 23:05:29 UTC |
| Source: | https://github.com/namgillee/varshrink |
Returns the estimated coefficient matrices of the lagged endogenous
variables as a list of matrices.
Acoef_sh(x)Acoef_sh(x)
x |
An object of class "varshrinkeset", generated by VARshrink(). |
Consider VAR(p) model:
The function returns the matrices
as a list object.
This function modifies vars::Acoef() for the class "varshrinkest",
preventing redundant copying of data matrix objects.
A list object with K-by-K VAR coefficient matrices
.
data(Canada, package = "vars") y <- diff(Canada) estim <- VARshrink(y, p = 2, type = "const", method = "ridge") Acoef_sh(estim)data(Canada, package = "vars") y <- diff(Canada) estim <- VARshrink(y, p = 2, type = "const", method = "ridge") Acoef_sh(estim)
Returns the estimated coefficients of a VAR(p) model as a matrix.
Bcoef_sh(x)Bcoef_sh(x)
x |
An object of class "varshrinkest" generated by |
Consider VAR(p) model:
The function returns the concatenated matrix as a matrix object.
This function modifies vars::Bcoef() for the class "varshrinkest",
preventing redundant copying of data matrix objects.
A matrix holding the estimated coefficients of a VAR.
data(Canada, package = "vars") y <- diff(Canada) estim <- VARshrink(y, p = 2, type = "const", method = "ridge") Bcoef_sh(estim)data(Canada, package = "vars") y <- diff(Canada) estim <- VARshrink(y, p = 2, type = "const", method = "ridge") Bcoef_sh(estim)
Compute sum of squared errors of coefficients of lagged endogenous variables (Acoef) of two VAR models.
calcSSE_Acoef(Acoef1, Acoef2)calcSSE_Acoef(Acoef1, Acoef2)
Acoef1, Acoef2
|
Each one is a list object with K-by-K coefficient matrices of lagged endogenous variables. See help(Acoef_sh), or, help(Acoef). |
Consider VAR(p) model:
The SSE of two VAR(p) models is expressed as
An SSE value.
data(Canada, package = "vars") y <- diff(Canada) estim1 <- VARshrink(y, p = 2, type = "const", method = "fbayes") Acoef1 <- Acoef_sh(estim1) estim2 <- VARshrink(y, p = 2, type = "const", method = "ridge") Acoef2 <- Acoef_sh(estim2) calcSSE_Acoef(Acoef1, Acoef2)data(Canada, package = "vars") y <- diff(Canada) estim1 <- VARshrink(y, p = 2, type = "const", method = "fbayes") Acoef1 <- Acoef_sh(estim1) estim2 <- VARshrink(y, p = 2, type = "const", method = "ridge") Acoef2 <- Acoef_sh(estim2) calcSSE_Acoef(Acoef1, Acoef2)
Convert a matrix of VAR coefficients estimated by a shrinkage method into a list of "shrinklm" object, where the class "shrinklm" inherits the class "lm".
convPsi2varresult( Psi, Y, X, lambda0, type = c("const", "trend", "both", "none"), ybar = NULL, xbar = NULL, Q_values = NULL, callstr = "" )convPsi2varresult( Psi, Y, X, lambda0, type = c("const", "trend", "both", "none"), ybar = NULL, xbar = NULL, Q_values = NULL, callstr = "" )
Psi |
An M-by-K matrix of VAR coefficients |
Y |
An N-by-K data matrix of dependent variables |
X |
An N-by-M data matrix of regressors |
lambda0 |
A rescaled shrinkage intensity parameter, based on which the effective number of parameters is computed by
|
type |
Type of deterministic variables in the VAR estimation problem. Either of "const", "trend", "both", or "none". |
ybar, xbar
|
NULL if Y and X are not centered. Mean vectors if Y and X had been centered. If Y and X had been centered (ybar and xbar are not NULL) and type is "const" or "both", then the coefficients for the constant term is computed and concatenated to the coefficients. |
Q_values |
Nonnegative weight vector of length N. Default is NULL. Take weights on rows (samples) of Y and X by sqrt(Q). |
callstr |
The call to VARshrink(). |
Consider VAR(p) model:
It can be written in the matrix form:
where is a concatenated M-by-K matrix,
.
It can be written in the multiple linear regression form of a VAR(p) model:
where , , and are the j-th column vectors of
Y, , and E, respectively.
This function converts into a list of "shrinklm" objects, where
each "shrinklm" object contains the length-M vector as
coefficients.
Considering that each coefficient vector is estimated by a
shrinkage method, the effective number of parameters, , is
computed as:
Then, the degree of freedom of residuals is computed as:
where N is the number of rows of data matrices Y and X.
A list object with objects of class c("shrinklm", "lm"). Each "shrinklm" object has components: coefficients, residuals, fitted.values, rank, df.residual, lambda0, call, terms, svd
Randomly create sparse lower-triangular matrices for VAR coefficients of lagged endogenous variables, and set a constant vector.
createVARCoefs_ltriangular( p = 1, K = 5, diag_val = 1/p, num_nonzero = 0, const_vector = NULL, range_min = 0.2, range_max = 1/p )createVARCoefs_ltriangular( p = 1, K = 5, diag_val = 1/p, num_nonzero = 0, const_vector = NULL, range_min = 0.2, range_max = 1/p )
p |
lag order |
K |
Number of time series variables. |
diag_val |
diagonal values of |
num_nonzero |
Number of nonzero entries on the lower-triangular parts of A1, ..., Ap |
const_vector |
constant vector c of the VAR model |
range_min, range_max
|
Each nonzero off-diagonal entry of coefficient matrices is drawn uniformly from the interval [-range_max, -range_min] U [range_min, range_max] |
Consider VAR(p) model:
with the constant deterministic variable .
The function creates the coefficient matrices and
constant vector c.
Diagonal elements of each K-by-K matrix are all equal to diag_val,
and off-diagonal elements are all zero except for a few randomly selected
nonzero elements. Nonzero off-diagonal elements are selected from
lower-triangular parts of and the values are drawn from a uniform
distribution over [-range_max, -range_min] U [range_min, range_max].
A list object with components $A and $c. $A is
a list of K-by-K matrices , and $c is a constant
vector of length K.
p <- 1; K <- 20; const_vector <- c(rep(0.2, 5), rep(0.7, 15)) createVARCoefs_ltriangular(p = p, K = K, diag_val = 0.6, num_nonzero = K, const_vector = const_vector, range_max = 1)p <- 1; K <- 20; const_vector <- c(rep(0.2, 5), rep(0.7, 15)) createVARCoefs_ltriangular(p = p, K = K, diag_val = 0.6, num_nonzero = K, const_vector = const_vector, range_max = 1)
Computes the impulse response coefficients of a VAR(p) (or transformed VECM to VAR(p)) for n.ahead steps.
## S3 method for class 'varshrinkest' irf( x, impulse = NULL, response = NULL, n.ahead = 10, ortho = TRUE, cumulative = FALSE, boot = TRUE, ci = 0.95, runs = 100, seed = NULL, ... )## S3 method for class 'varshrinkest' irf( x, impulse = NULL, response = NULL, n.ahead = 10, ortho = TRUE, cumulative = FALSE, boot = TRUE, ci = 0.95, runs = 100, seed = NULL, ... )
x |
Object of class "varshrinkest",
generated by |
impulse |
A character vector of the impulses, default is all variables. |
response |
A character vector of the responses, default is all variables. |
n.ahead |
Integer specifying the steps. |
ortho |
Logical, if TRUE (the default) the orthogonalised impulse response coefficients are computed (only for objects of class 'varshrinkest'). |
cumulative |
Logical, if TRUE the cumulated impulse response coefficients are computed. The default value is false. |
boot |
Logical, if TRUE (the default) bootstrapped confidence bands or Bayesian credible bands for the impulse response coefficients are computed. |
ci |
Numeric, the confidence level for the bootstrapped confidence or Bayesian credible bands. |
runs |
An integer, specifying the runs for the bootstrap. |
seed |
An integer, specifying the seed for the rng of the bootstrap. |
... |
Currently not used. |
Confidence intervals are computed by bootstrap methods in vars::irf()
or by Bayesian posterior distributions for an object of class
"varshrinkest".
For objects without stored MCMC draws, this method delegates to
vars::irf(). For objects with mcmc.param, point estimates are
computed from the fitted VAR coefficients and credible bands are computed
from posterior MCMC draws.
An object of class "varirf" with the same component structure as
vars::irf().
Estimate regression coefficients and scale matrix for noise by using Gibbs MCMC algorithm. The function assumes 1) multivariate t-distribution for noise as a sampling distribution, and 2) noninformative priors for regression coefficients and scale matrix for noise.
lm_full_Bayes_SR( Y, X, dof = Inf, burnincycle = 1000, mcmccycle = 2000, store_mcmc = TRUE )lm_full_Bayes_SR( Y, X, dof = Inf, burnincycle = 1000, mcmccycle = 2000, store_mcmc = TRUE )
Y |
An N x K matrix of dependent variables. |
X |
An N x M matrix of regressors. |
dof |
Degree of freedom for multivariate t-distribution.
If |
burnincycle, mcmccycle
|
Number of burnin cycles is the number of initially generated sample values to drop. Number of MCMC cycles is the number of generated sample values to compute estimates. |
store_mcmc |
TRUE to return all MCMC chain of estimated parameters across mcmccycle. Default is TRUE. |
Consider the multivariate regression:
is a M-by-K matrix of regression coefficients and
is a K-by-K scale matrix for multivariate t-distribution for
noise.
Sampling distribution for noise e is multivariate t-distribution with
degree of freedom dof and scale matrix .
The priors are noninformative priors: 1) the shrinkage prior for regression
coefficients , and 2) the reference prior for scale matrix
.
The function implements Gibbs MCMC algorithm for estimating regression coefficients Psi and scale matrix Sigma.
A list object with estimated parameters: Psi, Sigma, dof, delta (delta is the reciprocal of lambda), and lambda. Additional components are se.param (standard error of the parameters), mcmc.param (parameters for whole mcmc chain, stored if store_mcmc is TRUE), and linex.param (parameters estimates under LINEX loss).
S. Ni and D. Sun (2005). Bayesian estimates for vector autoregressive models. Journal of Business & Economic Statistics 23(1), 105-117.
Estimate regression coefficients by using ridge regression.
lm_multiv_ridge(Y, X, lambda = 0, do_scale = FALSE)lm_multiv_ridge(Y, X, lambda = 0, do_scale = FALSE)
Y |
An N x K matrix of dependent variables. |
X |
An N x M matrix of regressors. |
lambda |
Numeric vector of lambda values |
do_scale |
If true, X is centered and scaled, and Y is centered. |
Consider the multivariate regression:
is a M-by-K matrix of regression coefficients.
The ridge regression estimate for the coefficients is
A list object with the components: 1) Psi - A list of
estimated matrices, 2) lambda - A vector of
values, 3) GCV - A vector of GCV values
G. H. Golub, M. Heath, G. Wahba (1979). Generalized cross-validation as a method for choosing a good ridge parameter. Technometrics 21(2), 215-223. doi: 10.2307/1268518
Estimate regression coefficients and scale matrix for noise by using a parameterized cross validation (PCV). The function assumes 1) multivariate t-distribution for noise as a sampling distribution, and 2) informative priors for regression coefficients and scale matrix for noise.
lm_semi_Bayes_PCV( Y, X, dof = Inf, lambda = NULL, lambda_var = NULL, prior_type = c("NCJ", "CJ"), num_folds = 5, m0 = ncol(Y) )lm_semi_Bayes_PCV( Y, X, dof = Inf, lambda = NULL, lambda_var = NULL, prior_type = c("NCJ", "CJ"), num_folds = 5, m0 = ncol(Y) )
Y |
An N x K matrix of dependent variables. |
X |
An N x M matrix of regressors. |
dof |
Degrees-of-freedom, |
lambda |
If NULL or a vector of length >=2, it is selected by PCV. |
lambda_var |
If NULL, it is selected by a Stein-type shrinkage method. |
prior_type |
"NCJ" for non-conjugate prior and "CJ" for conjugate prior for scale matrix Sigma. |
num_folds |
Number of folds for PCV. |
m0 |
A hyperparameter for inverse Wishart distribution for Sigma |
Consider the multivariate regression:
is a matrix of regression coefficients
and is a scale matrix for
multivariate t-distribution for noise.
Sampling distribution for noise is the multivariate
t-distribution with the degrees-of-freedom and scale matrix
: .
The priors are informative priors: 1) a shrinkage prior for regression
coefficients , and 2) inverse Wishart prior for scale
matrix , which can be either non-conjugate ("NCJ")
or conjugate ("CJ") to the shrinkage prior for coefficients
.
The function implements parameterized cross validation (PCV) for selecting a shrinkage parameter lambda for estimating regression coefficients (0 < lambda <= 1). In addition, the function uses a Stein-type shrinkage method for selecting a shrinkage parameter lambda_var for estimating variances of time series variables.
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
Estimate regression coefficients and scale matrix for noise by using semiparametric Bayesian shrinkage estimator, whose shrinkage parameters are selected by k-fold cross validation (KCV).
lm_ShVAR_KCV( Y, X, dof = Inf, lambda = NULL, lambda_var = NULL, prior_type = c("NCJ", "CJ"), num_folds = 5, m0 = ncol(Y) )lm_ShVAR_KCV( Y, X, dof = Inf, lambda = NULL, lambda_var = NULL, prior_type = c("NCJ", "CJ"), num_folds = 5, m0 = ncol(Y) )
Y |
An N x K matrix of dependent variables. |
X |
An N x M matrix of regressors. |
dof |
Degree of freedom for multivariate t-distribution.
If |
lambda |
If |
lambda_var |
If |
prior_type |
"NCJ" for non-conjugate prior and "CJ" for conjugate prior for scale matrix Sigma. |
num_folds |
Number of folds for KCV. |
m0 |
A hyperparameter for inverse Wishart distribution for Sigma |
The shrinkage parameters, lambda and lambda_var, for the semiparametric Bayesian shrinkage estimator are selected by KCV. See help(lm_semi_Bayes_PCV) for details about semiparametric Bayesian estimator.
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
Returns the log-likelihood of a VAR model estimated by VARshrink().
It extends vars::logLik.varest() to incorporate
1) multivariate t-distribution for residuals,
2) scale matrix Sigma provided by shrinkage methods, and
3) effective number of parameters provided by shrinkage methods.
## S3 method for class 'varshrinkest' logLik(object, ...)## S3 method for class 'varshrinkest' logLik(object, ...)
object |
An object of class "varshrinkest" |
... |
Currently not used. |
log-likelihood of the fitted VAR model, with the class
attribute "logLik" and the attributes df and nobs.
data(Canada, package = "vars") y <- diff(Canada) estim <- VARshrink(y, p = 2, type = "const", method = "ridge") logLik(estim)data(Canada, package = "vars") y <- diff(Canada) estim <- VARshrink(y, p = 2, type = "const", method = "ridge") logLik(estim)
Returns the estimated coefficient matrices of the moving average representation of a stable VAR(p).
## S3 method for class 'varshrinkest' Phi(x, nstep = 10, ...)## S3 method for class 'varshrinkest' Phi(x, nstep = 10, ...)
x |
An object of class "varshrinkest",
generated by |
nstep |
An integer specifying the number of moving error coefficient matrices to be calculated. |
... |
Currently not used. |
This is a modification of vars::Phi.varest() for the class
"varshrinkest", preventing redundant copying of data matrix objects.
An array with dimension holding
the estimated coefficients of the moving average representation. The first
slice of the array is the starting value, i.e., .
print method for an object of class "varshrinkest"
## S3 method for class 'varshrinkest' print(x, digits = max(3, getOption("digits") - 3), ...)## S3 method for class 'varshrinkest' print(x, digits = max(3, getOption("digits") - 3), ...)
x |
An object of class "varshrinkest" |
digits, ...
|
Other arguments for |
data(Canada, package = "vars") y <- diff(Canada) estim <- VARshrink(y, p = 2, type = "const", method = "ridge") print(estim)data(Canada, package = "vars") y <- diff(Canada) estim <- VARshrink(y, p = 2, type = "const", method = "ridge") print(estim)
print method for an object obtained by summary.varshrinkest().
## S3 method for class 'varshsum' print( x, digits = max(3, getOption("digits") - 3), signif.stars = getOption("show.signif.stars"), ... )## S3 method for class 'varshsum' print( x, digits = max(3, getOption("digits") - 3), signif.stars = getOption("show.signif.stars"), ... )
x |
An object of class "varshsum" |
digits, signif.stars, ...
|
Other arguments for |
This function extends print.varsum() for VAR models estimated by
shrinkage methods.
The output includes the covariance matrix Sigma and the
degrees-of-freedom dof for the multivariate t-distribution for
the residuals.
Returns the estimated orthogonalized coefficient matrices of the moving average representation of a stable VAR(p).
## S3 method for class 'varshrinkest' Psi(x, nstep = 10, ...)## S3 method for class 'varshrinkest' Psi(x, nstep = 10, ...)
x |
An object of class "varshrinkest",
generated by |
nstep |
An integer specifying the number of orthogonalized moving error coefficient matrices to be calculated. |
... |
Currently not used. |
This is an extension of vars::Psi.varest() for the class
"varshrinkest".
An array with dimension holding
the estimated coefficients of the orthogonalized moving average
representation.
Computes the multivariate Portmanteau- and Breusch-Godfrey test for serially correlated errors.
serial.test_sh( x, lags.pt = 16, lags.bg = 5, type = c("PT.asymptotic", "PT.adjusted", "BG", "ES") )serial.test_sh( x, lags.pt = 16, lags.bg = 5, type = c("PT.asymptotic", "PT.adjusted", "BG", "ES") )
x |
An object of class "varshrinkest" obtained by VARshrink(). |
lags.pt, lags.bg, type
|
Other arguments for |
An extension of vars::serial.test() to the class "varshrinkest".
An object of class "varcheck" computed by
vars::serial.test().
data(Canada, package = "vars") y <- diff(Canada) estim <- VARshrink(y, p = 2, type = "const", method = "ridge") serial.test_sh(estim)data(Canada, package = "vars") y <- diff(Canada) estim <- VARshrink(y, p = 2, type = "const", method = "ridge") serial.test_sh(estim)
Compute the semiparametric Bayesian shrinkage estimator of Psi and Sigma for a given shrinkage parameter lambda. The function is a private function for lm_semi_Bayes_PCV() and lm_ShVAR_KCV().
shrinkVARcoef( Y, X, lambda, dof = Inf, prior_type = "NCJ", TolDRes = 1e-04, m0 = ncol(Y) )shrinkVARcoef( Y, X, lambda, dof = Inf, prior_type = "NCJ", TolDRes = 1e-04, m0 = ncol(Y) )
Y |
An N x K matrix of dependent variables. |
X |
An N x M matrix of regressors. |
lambda |
A shrinkage intensity parameter value between 0~1. |
dof |
Degree of freedom for multivariate t-distribution. If NULL or Inf, then use multivariate normal distribution. |
prior_type |
"NCJ" for non-conjugate prior and "CJ" for conjugate prior for scale matrix Sigma. |
TolDRes |
Tolerance parameter for stopping criterion. |
m0 |
A hyperparameter for inverse Wishart distribution for Sigma |
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
Generate a multivariate time series data set using the given VAR model.
simVARmodel(numT, model, burnin = 0)simVARmodel(numT, model, burnin = 0)
numT |
Number of observed time points, T. |
model |
A list object with Coef, Sigma, dof; Coef is a list with A and c; A is a list object of K-by-K coefficient matrices and c is a length-K vector. Sigma is a K-by-K scale matrix and dof is a degree of freedom for multivariate t-distribution for noise. |
burnin |
Number of initial points which are not included in the final values. |
First, it creates (p+burnin+numT x K) data, then it remove the first (p+burnin) vectors. Finally, it returns (numT x K) data.
A numT-by-K matrix
myCoef <- list(A = list(matrix(c(0.5, 0, 0, 0.5), 2, 2)), c = c(0.2, 0.7)) myModel <- list(Coef = myCoef, Sigma = diag(0.1^2, 2), dof = Inf) simVARmodel(numT = 100, model = myModel, burnin = 10)myCoef <- list(A = list(matrix(c(0.5, 0, 0, 0.5), 2, 2)), c = c(0.2, 0.7)) myModel <- list(Coef = myCoef, Sigma = diag(0.1^2, 2), dof = Inf) simVARmodel(numT = 100, model = myModel, burnin = 10)
Computes empirical fluctuation processes for VAR estimates.
Utilizes strucchange::efp() for the VAR estimates of each time series
variable.
stability_sh( x, type = c("OLS-CUSUM", "Rec-CUSUM", "Rec-MOSUM", "OLS-MOSUM", "RE", "ME", "Score-CUSUM", "Score-MOSUM", "fluctuation"), h = 0.15, dynamic = FALSE, rescale = TRUE, ... )stability_sh( x, type = c("OLS-CUSUM", "Rec-CUSUM", "Rec-MOSUM", "OLS-MOSUM", "RE", "ME", "Score-CUSUM", "Score-MOSUM", "fluctuation"), h = 0.15, dynamic = FALSE, rescale = TRUE, ... )
x |
Object of class "varshrinkest" |
type, h, dynamic, rescale, ...
|
Other arguments to
|
A variant of vars::stability() for an object of class "varshrinkest".
A list with class attribute "varstabil" which contains the following
elements: stability, endog, K. The stability is
a list of strucchange::efp() outputs.
data(Canada, package = "vars") y <- diff(Canada) estim <- VARshrink(y, p = 2, type = "const", method = "ridge") stabil <- stability_sh(estim) plot(stabil)data(Canada, package = "vars") y <- diff(Canada) estim <- VARshrink(y, p = 2, type = "const", method = "ridge") stabil <- stability_sh(estim) plot(stabil)
summary method for an object of class "shrinklm".
## S3 method for class 'shrinklm' summary(object, correlation = FALSE, symbolic.cor = FALSE, ...)## S3 method for class 'shrinklm' summary(object, correlation = FALSE, symbolic.cor = FALSE, ...)
object |
An object of class "shrinklm" |
correlation |
If TRUE, the correlation matrix of the the estimated coefficients is returned and printed. |
symbolic.cor |
If TRUE, print the correlations in a symbolic form rather than as numbers |
... |
Currently not used. |
The class "shrinklm" inherits from the class "lm", and extends it to incorporate shrinkage estimates with the effective number of parameters.
Returns a list with class attribute "summary.lm", which contains summary statistics of the fitted linear model given in object.
Extend summary.varest() to the class "varshrinkest" to incorporate
adapted methods for the new classes:
summary.shrinklm(), logLik.varshrinkest().
## S3 method for class 'varshrinkest' summary(object, equations = NULL, ...)## S3 method for class 'varshrinkest' summary(object, equations = NULL, ...)
object |
An object of class "varshrinkest", usually a result of call to "VARshrink()". |
equations |
Subset of names of endogenous time series variables to summarize. |
... |
Currently not used. |
The code has been modified to eliminate direct calls to the data matrices
($y, $datamat) and to use the effective numbers of parameters
obtained from the shrinkage estimates. The output additionally includes the
covariance matrix Sigma and the degrees-of-freedom dof
of the multivariate t-distribution for the residuals.
Returns a list with class attribute "varshsum" and "varsum" which contains the following elements: names, logLik, obs, roots, type, call, varresult, covres, corres, Sigma, dof.
data(Canada, package = "vars") y <- diff(Canada) estim <- VARshrink(y, p = 2, type = "const", method = "ridge") summary(estim)data(Canada, package = "vars") y <- diff(Canada) estim <- VARshrink(y, p = 2, type = "const", method = "ridge") summary(estim)
Shrinkage estimation methods for high-dimensional VAR models. Consider VAR(p) model:
where is K-dimensional time series,
is deterministic regressors, is a noise process, and
, and are coefficient matrices.
Exogenous variables can be included additionally as regressors.
VARshrink( y, p = 1, type = c("const", "trend", "both", "none"), season = NULL, exogen = NULL, method = c("ols", "ridge", "ns", "fbayes", "sbayes", "kcv"), lambda = NULL, lambda_var = NULL, dof = Inf, ... )VARshrink( y, p = 1, type = c("const", "trend", "both", "none"), season = NULL, exogen = NULL, method = c("ols", "ridge", "ns", "fbayes", "sbayes", "kcv"), lambda = NULL, lambda_var = NULL, dof = Inf, ... )
y |
A T-by-K matrix of endogenous variables |
p |
Integer for the lag order |
type |
Type of deterministic regressors to include.
1) |
season |
An integer value of frequency for inclusion of
centered seasonal dummy variables. |
exogen |
A T-by-L matrix of exogenous variables. Default is |
method |
1) |
lambda, lambda_var
|
Shrinkage parameter value(s). Use of this parameter is slightly different for each method: the same value does not imply the same shrinkage estimates. |
dof |
Degree of freedom of multivariate t-distribution for noise.
Valid only for |
... |
Extra arguments to pass to a specific function of the
estimation method. For example, burnincycle and mcmccycle are for
|
Shrinkage estimation methods can estimate the coefficients even when the dimensionality K is larger than the number of observations.
An object of class "varshrinkest" with the components: varresult, datamat, y, type, p, K, obs, totobs, restrictions, method, lambda, call. The class "varshrinkest" inherits the class "varest" in the package vars.
data(Canada, package = "vars") y <- diff(Canada) VARshrink(y, p = 2, type = "const", method = "ridge")data(Canada, package = "vars") y <- diff(Canada) VARshrink(y, p = 2, type = "const", method = "ridge")