ivx fits predictive regression models. The method allows standard chi-square testing for regressors with different degrees of persistence, from stationary to mildly explosive, and can be used for both short- and long-horizon predictive regressions.
ivx(
formula,
data,
horizon,
na.action,
weights,
contrasts = NULL,
offset,
model = TRUE,
x = FALSE,
y = FALSE,
...
)# S3 method for ivx
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).
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 <U+2018>factory-fresh<U+2019>
default is na.omit
. Another possible value is NULL
,
no action. Value na.exclude
can be useful.
an optional vector of weights to be used in the fitting process.
Should be NULL
or a numeric vector. If non-NULL, weighted least squares is used
with weights weights
(that is, minimizing sum(w*e^2)
); otherwise ordinary
least squares is used.
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", usually, a result of a call to ivx.
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.
an object of class "ivx".
Magdalinos, T., & Phillips, P. (2009). Limit Theory for Cointegrated Systems with Moderately Integrated and Moderately Explosive Regressors. Econometric Theory, 25(2), 482-526.
Kostakis, A., Magdalinos, T., & Stamatogiannis, M. P. (2014). Robust econometric inference for stock return predictability. The Review of Financial Studies, 28(5), 1506-1553.
# NOT RUN {
# Univariate
ivx(Ret ~ LTY, data = kms)
# Multivariate
ivx(Ret ~ LTY + TBL, data = kms)
# Longer horizon
ivx(Ret ~ LTY + TBL, data = kms, horizon = 4)
wt <- runif(nrow(kms))
ivx(Ret ~ LTY, data = kms, weights = wt)
# }
Run the code above in your browser using DataLab