Learn R Programming

tsaux (version 1.0.0)

check_xreg: Checks on regressor matrix.

Description

Used internally by other packages, these functions provides some commonly used validation checks on regressor matrices in both in and out of sample.

Usage

check_xreg(xreg, valid_index)

check_newxreg(newdata, xreg_names = NULL, h = 1, forc_dates = NULL)

Value

Returns the xts input matrix if checks are passed else raises an error.

Arguments

xreg

an xts matrix of named regressors.

valid_index

a vector of dates against which the xreg matrix index is compared for validity.

newdata

an xts matrix of out of named sample regressors.

xreg_names

names of regressors used in sample.

h

the forecast horizon

forc_dates

an optional vector of forecast dates. This is used if newdata is not an xts matrix in which case it formats the data into such using the forc_dates vector.