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.
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), ...)
an object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted.
n optional data frame, list or environment (or object coercible by
as.data.frame
to a data frame) containing
the variables in the model. If not found in data, the variables are taken
from environment(formula), typically the environment from which lm is called.
is the horizon (default horizon = 1 corresponds to a short-horizon regression).
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.
Information criterion to be used in model selection.
Maximum ar order of model to fit.
The ar grid sequence of which to iterate.
a function which indicates what should happen when the data
contain NAs. The default is set by the na.action setting of options
,
and is na.fail
if that is unset. The ‘factory-fresh’
default is na.omit
. Another possible value is NULL
,
no action. Value na.exclude
can be useful.
an optional list. See the contrasts.arg
of
model.matrix.default
.
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
logical. If TRUE
the model.frame of the fit is returned.
an object of class "ivx_ar", usually, a result of a call to ivx_ar.
logical. If TRUE
the response of the fit is returned.
additional arguments to be passed to the low level regression fitting functions (see lm).
the number of significant digits to use when printing.
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: 10.1080/01621459.2019.1686392
ivx_ar(hpi ~ log(res) + cpi, ylpc)
#>
#> Call:
#> ivx_ar(formula = hpi ~ log(res) + cpi, data = ylpc, horizon = 1)
#>
#> Lag Selection:
#> Auto (bic) with AR terms q = 4
#>
#> Coefficients:
#> log(res) cpi
#> 0.0018317 -0.0002078
#>
ivx_ar(hpi ~ log(res) + cpi, ylpc, ar_ic = "aic")
#>
#> Call:
#> ivx_ar(formula = hpi ~ log(res) + cpi, data = ylpc, ar_ic = "aic",
#> horizon = 1)
#>
#> Lag Selection:
#> Auto (aic) with AR terms q = 4
#>
#> Coefficients:
#> log(res) cpi
#> 0.0018317 -0.0002078
#>
ivx_ar(hpi ~ log(res) + cpi, ylpc, ar = 1)
#>
#> Call:
#> ivx_ar(formula = hpi ~ log(res) + cpi, data = ylpc, ar = 1, horizon = 1)
#>
#> Lag Selection:
#> Fixed with AR terms q = 1
#>
#> Coefficients:
#> log(res) cpi
#> 0.0010780 -0.0001155
#>