HDvar: Estimate High-dimensional VARs

Description Usage Arguments Value References See Also Examples

View source: R/HDvar.R

Description

Estimate High-dimensional Vector Autorregressive models using the model chosen by the user. The model must be parametric.

Usage

1
HDvar(Y, p, fn = NULL, xreg = NULL)

Arguments

Y

Time-series matrix or data.frame with the VAR endogenous variables.

p

Lag order (default = 1).

fn

A function that receives x (independent variables) and y (dependent variable) and returns the model coefficients (default is OLS).

xreg

Exogenous controls.

Value

An object with S3 class "HDeconometricsVAR", "HDvar".

coef.by.equation

Coefficients listed by each VAR equation.

coef.by.block

Coefficients separated by blocks (intercepts, lags, exogenous).

fitted.values

In-sample fitted values.

residuals

The residuals.

Y

Supplied endogenous data.

p

VAR lag order chosen by the user.

N

Number of endogenous variables.

covmat

Residuals covariance matrix.

xreg

Exogenous controls supplied by the user.

T

Number of observations.

fn

The estimation function.

call

The matched call.

References

Garcia, Medeiros and Vasconcelos (2017).

See Also

predict, lbvar, irf

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## == This example uses the Brazilian inflation data from
#Garcia, Medeiros and Vasconcelos (2017) == ##
data("BRinf")
Y=BRinf[,1:59]# remove expectation variables

fn=function(x,y){
  model=ic.glmnet(x,y)
  coef(model)
}

modelH=HDvar(Y,p=4,fn=fn)

# take a look at the coefficients
eq=coef(modelH,type="equation")
block=coef(modelH,type="block")
block$Lag1

gabrielrvsc/HDeconometrics documentation built on April 28, 2020, 7:12 a.m.