Learn R Programming

pvars (version 1.1.1)

as.varx: Coerce into a 'varx' object

Description

Coerce into a 'varx' object. On top of the parent class 'varx', the child class 'id' is imposed if the input object to be transformed contains an SVAR model.

Usage

as.varx(x, ...)

Value

A list of class 'varx'. Objects of this class contain the elements:

A

Matrix. The lined-up VAR coefficient matrices \(A_j, j=1,\ldots,p\) for the lagged variables.

B

Matrix. The \((K \times S)\) structural impact matrix of the SVAR model or an identity matrix \(I_K\) as a placeholder for the unidentified VAR model.

beta

Matrix. The \(((K+n_{d1}) \times r)\) cointegrating matrix of the VAR model if transformed from a rank-restricted VECM.

SIGMA

Matrix. The \((K \times K)\) residual covariance matrix estimated by least-squares.

The following integers indicate the size of dimensions:

dim_K

Integer. The number of endogenous variables \(K\) in the full-system.

dim_S

Integer. The number of identified shocks \(S\) in the SVAR model.

dim_T

Integer. The number of time periods \(T\) without presample.

dim_p

Integer. The lag-order \(p\) of the VAR model in levels.

dim_r

Integer. The cointegration rank \(r\) of the VAR model if transformed from a rank-restricted VECM.

Some further elements required for the bootstrap functions are:

y

Matrix. The \((K \times (p+T))\) endogenous variables.

D,D1,D2

Matrices. The \((n_{\bullet} \times (p+T))\) deterministic variables, fixed over bootstrap iterations, (un)restricted to the cointegration relations of the VAR model if transformed from a rank-restricted VECM.

resid

Matrix. The \((K \times T)\) residual matrix.

args_varx

List of characters and integers indicating the estimator and specifications that have been used.

args_id

List of characters and integers indicating the identification methods and specifications that have been used. This element is specific to the child-class 'id' for SVAR models, that inherit from parent-class 'varx' for any VAR model.

Arguments

x

A VAR object to be transformed.

...

Additional arguments to be passed to or from methods.

Details

as.varx is used as an intermediary in the pvars functions to achieve compatibility with different classes of VAR objects. If the user wishes to extend this compatibility with further classes, she may simply specify accordant as.varx-methods instead of altering the original pvars function. Classes already covered by pvars are those of the vars ecosystem, in particular the classes

  • 'varest' for reduced-form VAR estimates from VAR,

  • 'vec2var' for reduced-form VECM estimates from vec2var,

  • 'svarest' for structural VAR estimates from BQ,

  • 'svecest' for structural VECM estimates from SVEC, and

  • 'svars' for structural VAR estimates from svars' id.chol, id.cvm, or id.dc.

By transformation to 'varx', these VAR estimates can thus be subjected to pvars' bootstrap procedure sboot.mb and S3 methods such as summary and toLatex.

Examples

Run this code
data("PCIT")
names_k = c("APITR", "ACITR", "PITB", "CITB", "GOV", "RGDP", "DEBT")

# estimate reduced-form VAR and coerce into 'varx' object #
R.vars = vars::VAR(PCIT[ , names_k], p=4, type="const")
as.varx(R.vars)

# identify structural VAR and coerce into 'id' object #
R.svar = svars::id.chol(R.vars, order_k=names_k)
as.varx(R.svar)

Run the code above in your browser using DataLab