ivx_ar {ivx} | R Documentation |
Fitting IVX-AR Models
Description
ivx_ar implements the Yang et al (2020) new instrumental variable based Wald statistic (IVX-AR) which accounts for serial correlation and heteroscedasticity in the error terms of the linear predictive regression model.
Usage
ivx_ar(
formula,
data,
horizon,
ar = "auto",
ar_ic = c("bic", "aic", "aicc"),
ar_max = 5,
ar_grid = function(x) seq(x - 0.3, x + 0.3, by = 0.02),
na.action,
contrasts = NULL,
offset,
model = TRUE,
x = FALSE,
y = FALSE,
...
)
## S3 method for class 'ivx_ar'
print(x, digits = max(3L, getOption("digits") - 3L), ...)
Arguments
formula |
an object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted. |
data |
n optional data frame, list or environment (or object coercible by
|
horizon |
is the horizon (default horizon = 1 corresponds to a short-horizon regression). |
ar |
Method to include the autoregressive terms. "auto" find the optimal
ar order by using the information criteria. |
ar_ic |
Information criterion to be used in model selection. |
ar_max |
Maximum ar order of model to fit. |
ar_grid |
The ar grid sequence of which to iterate. |
na.action |
a function which indicates what should happen when the data
contain NAs. The default is set by the na.action setting of |
contrasts |
an optional list. See the |
offset |
this can be used to specify an a priori known component to be included in the linear predictor during fitting. This should be NULL or a numeric vector or matrix of extents matching those of the response. One or more offset terms can be included in the formula instead or as well, and if more than one are specified their sum is used. See model.offset |
model |
logical. If |
x |
an object of class "ivx_ar", usually, a result of a call to ivx_ar. |
y |
logical. If |
... |
additional arguments to be passed to the low level regression fitting functions (see lm). |
digits |
the number of significant digits to use when printing. |
References
Yang, B., Long, W., Peng, L., & Cai, Z. (2020). Testing the Predictability of US Housing Price Index Returns Based on an IVX-AR Model. Journal of the American Statistical Association, 1-22. DOI: doi: 10.1080/01621459.2019.1686392
Examples
ivx_ar(hpi ~ log(res) + cpi, ylpc)
ivx_ar(hpi ~ log(res) + cpi, ylpc, ar_ic = "aic")
ivx_ar(hpi ~ log(res) + cpi, ylpc, ar = 1)