# ivx_ar_fit: Fitter Functions for IVX-AR Models In ivx: Robust Econometric Inference

## Description

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

## Usage

 ``` 1 2 3 4 5 6 7 8 9 10 11``` ```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

 ```1 2 3``` ```ivx_ar_fit(monthly\$Ret, as.matrix(monthly\$LTY)) ivx_ar_fit(monthly\$Ret, as.matrix(monthly\$LTY), ar = 1) ```

ivx documentation built on Nov. 27, 2020, 5:09 p.m.