varxfit: VARX Fit/Filter/Forecast/Simulation Functions

Description Usage Arguments Details Value Note Author(s) References

View source: R/rmgarch-var.R

Description

Vector Autoregressive (VAR) with Constant and Optional Exogenous Regressors (X) Fit, Filter, Forecast and Simulation functions for use with multivariate GARCH models.

Usage

1
2
3
4
5
varxfit(X, p, exogen = NULL, robust = FALSE, gamma = 0.25, delta = 0.01, nc = 10, 
ns = 500, postpad = c("none", "constant", "zero", "NA"), cluster = NULL)
varxfilter(X, p, Bcoef, exogen = NULL, postpad = c("none", "constant", "zero", "NA"))
varxforecast(X, Bcoef, p, out.sample, n.ahead, n.roll, mregfor)
varxsim (X, Bcoef, p, n.sim, n.start, prereturns, resids, mexsimdata)

Arguments

X

A multivariate data matrix.

p

The number of autoregressive lags.

exogen

An optional matrix of exogenous regressors with as many rows as X, and appropriately lagged.

Bcoef

A matrix of coefficients for the varxfilter function.

robust

Whether to use the robust version of VAR based on the multivariate Least Trimmed Squares Estimator described in Croux and Joossens (2008).

gamma

Proportion to trim in the robust method.

delta

The critical value for Reweighted estimator for the robust method.

ns

The number of subsets to use for the robust method.

nc

The number of C-steps to use for the robust method.

postpad

(defaults to ‘none’) Whether to postpad the fitted/filtered values (and hence calculation of residuals) with the estimated constant, zeros or NA's, thus returning matrices of the same size as the input data (rather than input data size less the number of lags).

cluster

A cluster object created by calling makeCluster from the parallel package. If it is not NULL, then this will be used for parallel estimation in the case of the robust VAR version (remember to stop the cluster on completion).

out.sample

The number of points kept for out of sample rolling forecast.

n.ahead

The forecast horizon.

n.roll

In combination with out.sample, determines the number of times to roll forward the n.ahead forecast using data left out of sample.

mregfor

Matrix of external regressor forecasts (with appropriate lag structure).

n.sim

Simulation horizon.

n.start

Simulation burn-in sample.

prereturns

Optionally supplied pre-return matrix with “p” lags to initialize simulation.

resids

Matrix of randomly generated residuals of size n.sim+n.start.

mexsimdata

Matrix of external regressor pre-generated random values to use in the simulation (if NULL then assumed zero).

Details

This are convenience functions to be optionally used when using the multivariate GARCH methods.

Value

A list with the following items:

Bcoef

[varxfit, varxfilter]
The coefficient matrix with rows equal to number of assets, and columns equal to number of assets x number of lags plus 1 (constant) plus number of exogenous regressors.

xfitted

[varxfit, varxfilter]
The fitted/filtered series (conditional mean series).

xresiduals

[varxfit, varxfilter]
The residuals.

Bcov

[varxfit]
The covariance matrix of the coefficients.

se

[varxfit]
The standard error of the coefficients.

tstat

[varxfit]
The t-stat of the s.e.

pstat

[varxfit]
The p-values of the s.e.

lag

[varxfit, varxfilter]
The number of autoregressive lags.

mxn

[varxfit]
The number of exogenous regressors .

meansim

[varxsim]
The simulated conditional mean.


The varxsim returns an n.sim x n.asset matrix of the simulated conditional means, while the varxforecast returns an n.ahead x n.assets x (n.roll+1) array of the forecast conditional means.

Note

Part of the varxfit functionality and structure is inspired from the 'vars' package, but the estimation method is implemented in a very quick way without calling 'lm'. The robust method is based on the matlab program of Christophe Croux available from his website and the option of using parallel computation is implemented for this particular choice.The postpad option is used when the returned data needs to be of the same size as the inputed data for easier manipulation/comparison (since padding is done post-estimation, there is no bias introduced during estimation).

Author(s)

Alexios Ghalanos

References

Lutkepohl, H. 2005, New introduction to multiple time series analysis, Springer.
Croux, C. and Joossens, K. 2008, Robust estimation of the vector autoregressive model by a least trimmed squares procedure, COMPSTAT, 489–501.


rmgarch documentation built on May 2, 2019, 5:56 p.m.