ivx_ar_fit {ivx}R Documentation

Fitter Functions for IVX-AR Models

Description

Basic function called by ivx_ar to fit predictive models. These should only be used directly by experienced users.

Usage

ivx_ar_fit(
  y,
  x,
  horizon = 1,
  offset = NULL,
  ar = "auto",
  ar_max = 5,
  ar_ic = "bic",
  ar_grid = function(x) seq(x - 0.3, x + 0.3, by = 0.02),
  ...
)

Arguments

y

vector of observations of length n, or a matrix with n rows.

x

design matrix of dimension n * p.

horizon

is the horizon (default horizon = 1 corresponds to a short-horizon regression).

offset

(numeric of length n). This can be used to specify an a priori known component to be included in the linear predictor during fitting.

ar

Method to include the autoregressive terms. "auto" find the optimal ar order by using the information criteria. ar = 0 reduces to simple ivx. ar > 1 uses a fixed order to estimate the model.

ar_max

Maximum ar order of model to fit.

ar_ic

Information criterion to be used in model selection.

ar_grid

The ar grid sequence of which to iterate.

...

Further arguments passed to the function which is fitting the best AR model. If ar = "auto" then the internal function auto_ar is used, if ar = "forecast" then the the function forecast::auto.arima is used. If ar is of fixed length then arima is used.

Examples


ivx_ar_fit(monthly$Ret, as.matrix(monthly$LTY))

ivx_ar_fit(monthly$Ret, as.matrix(monthly$LTY), ar = 1)


[Package ivx version 1.1.0 Index]