| Title: | Robust Econometric Inference |
|---|---|
| Description: | Drawing statistical inference on the coefficients of a short- or long-horizon predictive regression with persistent regressors by using the IVX method of Magdalinos and Phillips (2009) <doi:10.1017/S0266466608090154> and Kostakis, Magdalinos and Stamatogiannis (2015) <doi:10.1093/rfs/hhu139>. Also provides the extensions of IVX proposed in the later literature (IVX-AR, residual-augmented and lag-augmented IVX, IVX quantile regression, systems of predictive regressions, heteroskedasticity-robust standard errors, wild-bootstrap and subsample inference, combined instruments) and the standard non-IVX tests for predictability with persistent regressors as benchmarks. |
| Authors: | Kostas Vasilopoulos [cre, aut], Efthymios Pavlidis [aut] |
| Maintainer: | Kostas Vasilopoulos <[email protected]> |
| License: | GPL-3 |
| Version: | 2.0.0 |
| Built: | 2026-09-23 12:09:47 UTC |
| Source: | https://github.com/kvasilopoulos/ivx |
Autocorrelation tests
ac_test(x, lag_max = 5)ac_test(x, lag_max = 5)
x |
the residuals or an |
lag_max |
the maximum length of lags. |
obj <- ivx(hpi ~ cpi + def + int + log(res), data = ylpc) if (requireNamespace("lmtest", quietly = TRUE)) { lmtest::bgtest(hpi ~ cpi + def + int + log(res), data = ylpc) } ac_test(obj, 5)obj <- ivx(hpi ~ cpi + def + int + log(res), data = ylpc) if (requireNamespace("lmtest", quietly = TRUE)) { lmtest::bgtest(hpi ~ cpi + def + int + log(res), data = ylpc) } ac_test(obj, 5)
ac_test: For all tests
ac_test_wald: Wald test
ac_test_lb: Ljung-Box
ac_test_bp: Box-Pierce
ac_test_bg: Breusch-Godfrey
ac_test_wald(x, lag) ac_test_lb(x, lag) ac_test_bp(x, lag) ac_test_bg(x, order, type, fill)ac_test_wald(x, lag) ac_test_lb(x, lag) ac_test_bp(x, lag) ac_test_bg(x, order, type, fill)
x |
an |
lag |
the number of lags. |
order |
lag TODO |
type |
the type of test statistic to be returned. Either "Chisq" for the Chi-squared test statistic or "F" for the F test statistic. |
fill |
starting values for the lagged residuals in the auxiliary regression. By default 0 but can also be set to NA. |
If p-value < 0.051: You can reject the null hypothesis assuming a 5% chance of making a mistake. So you can assume that your values are showing dependence on each other.
a numeric scalar or numeric vector.
Box.test lmtest::bgtest
mdl <- ivx(hpi ~ cpi + inv, data = ylpc) ac_test_wald(mdl) ac_test(mdl)mdl <- ivx(hpi ~ cpi + inv, data = ylpc) ac_test_wald(mdl) ac_test(mdl)
arm implements the multipredictor augmented regression method (mARM) of
Amihud, Hurvich and Wang (2009), a reduced-bias OLS alternative to IVX for
stationary but persistent predictors. A VAR(1) is fitted to the predictors,
its coefficient matrix is bias-corrected with the Nicholls and Pope (1988)
expansion (iterated), and the predictive regression is augmented with the
corrected VAR residuals, which removes the Stambaugh (1999) bias from the
slopes. Standard errors and the joint Wald statistic use the covariance
estimator of the paper (eqs 7-8), which adds the estimation uncertainty of
the VAR coefficients to the augmented-regression OLS variance.
arm( formula, data, iter = 10, na.action, contrasts = NULL, model = TRUE, x = FALSE, y = FALSE, ... ) ## S3 method for class 'arm' print(x, digits = max(3L, getOption("digits") - 3L), ...)arm( formula, data, iter = 10, na.action, contrasts = NULL, model = TRUE, x = FALSE, y = FALSE, ... ) ## S3 method for class 'arm' print(x, digits = max(3L, getOption("digits") - 3L), ...)
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
|
iter |
maximum number of bias-correction iterations ( |
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 |
model |
logical. If |
x |
an object of class "arm". |
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. |
Unlike IVX the method assumes stationary predictors (all eigenvalues of the VAR coefficient matrix inside the unit circle) and Gaussian innovations; it is the natural benchmark for the "control function" approach of Elliott (2011). Short horizon only.
an object of class c("arm", "ivx"), so the ivx methods apply.
Additional components: phi (coefficients on the augmentation residuals),
Phi (bias-corrected VAR(1) coefficient matrix, equations by row) and
Phi_ols.
Amihud, Y., Hurvich, C. M., & Wang, Y. (2009). Multiple-predictor regressions: Hypothesis testing. The Review of Financial Studies, 22(1), 413-434.
Amihud, Y., & Hurvich, C. M. (2004). Predictive regressions: A reduced-bias estimation method. Journal of Financial and Quantitative Analysis, 39(4), 813-841.
Nicholls, D. F., & Pope, A. L. (1988). Bias in the estimation of multivariate autoregressions. Australian Journal of Statistics, 30A, 296-309.
arm(Ret ~ DP, data = kms) summary(arm(Ret ~ DP + TBL, data = kms))arm(Ret ~ DP, data = kms) summary(arm(Ret ~ DP + TBL, data = kms))
Basic function called by arm. Should only be used directly by experienced
users.
arm_fit(y, x, iter = 10, ...)arm_fit(y, x, iter = 10, ...)
y |
vector of observations of length |
x |
design matrix of dimension |
iter |
maximum number of bias-correction iterations ( |
... |
currently unused. |
arm_fit(kms$Ret, as.matrix(kms$DP))$tstatarm_fit(kms$Ret, as.matrix(kms$DP))$tstat
cy_test implements the Bonferroni Q-test of Campbell and Yogo (2006), the
standard feasible version of the sup-bound / Bonferroni approach of
Cavanagh, Elliott and Stock (1995). For a single predictor
(AR(p) dynamics allowed, Appendix A),
the procedure is:
estimate the innovation correlation between the
predictive-regression residual and the ADF innovation of the predictor
(lag length by BIC, );
compute the DF-GLS statistic of Elliott, Rothenberg and Stock (1996)
and invert its local-to-unity null distribution (Stock, 1991) into a
confidence interval for ,
with lower and upper levels ,
from the paper's Table 2, which refine the
Bonferroni bound so that the one-sided test has size 5\
for at each end of the interval compute the Q-estimate
of eq. (25) - OLS of on the demeaned
after subtracting ,
with the Phillips-Perron-type correction
when - and its standard error ;
the 90\
(eq. 17); the 5\
bound is positive and if the upper bound is negative.
The DF-GLS null quantiles are tabulated by simulation for
(see data-raw/dfgls-quantiles.R); a statistic outside
the tabulated range is clamped to the boundary, which for very negative
values (a clearly stationary predictor) makes the interval for
start at . Table 2 is given for ; for
the predictor is sign-flipped, which flips
and the alternative, and the results are mapped back.
cy_test(formula, data, lag_max = NULL, na.action) cy_test_fit(y, x, lag_max = NULL) ## S3 method for class 'cy_test' print(x, digits = max(3L, getOption("digits") - 3L), ...)cy_test(formula, data, lag_max = NULL, na.action) cy_test_fit(y, x, lag_max = NULL) ## S3 method for class 'cy_test' print(x, digits = max(3L, getOption("digits") - 3L), ...)
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
|
lag_max |
maximum ADF lag order for the BIC search; the default is
|
na.action |
a function which indicates what should happen when the data
contain NAs. The default is set by the na.action setting of |
y |
response vector. |
x |
an object of class "cy_test". |
digits |
minimal number of significant digits. |
... |
unused. |
an object of class "cy_test": a list with ci (the 90\
interval for ), reject (named logical: greater, less),
estimate (OLS slope), beta_rho ( at
and ), se, delta, dfgls, c_ci, rho_ci, alpha1,
lag and n.
Campbell, J. Y., & Yogo, M. (2006). Efficient tests of stock return predictability. Journal of Financial Economics, 81(1), 27-60.
Cavanagh, C. L., Elliott, G., & Stock, J. H. (1995). Inference in models with nearly integrated regressors. Econometric Theory, 11(5), 1131-1147.
Elliott, G., Rothenberg, T. J., & Stock, J. H. (1996). Efficient tests for an autoregressive unit root. Econometrica, 64(4), 813-836.
Stock, J. H. (1991). Confidence intervals for the largest autoregressive root in U.S. macroeconomic time series. Journal of Monetary Economics, 28(3), 435-459.
cy_test(Ret ~ DP, data = kms)cy_test(Ret ~ DP, data = kms)
Computes the long-run correlation coefficient between the residuals of the predictive regression and the autoregressive model for the regressor.
delta(object)delta(object)
object |
on object of class "ivx" |
A vector of the estimated correlation coefficients. This should have row and column names corresponding to the parameter names given by the coef method.
mod <- ivx(Ret ~ LTY, data = monthly) delta(mod)mod <- ivx(Ret ~ LTY, data = monthly) delta(mod)
el_test implements the unified empirical likelihood (EL) test of Liu,
Yang, Cai and Peng (2019, Section 2.2) for the predictive regression with
unknown intercept
where the lagged difference of the predictor is included so that the
response can be stationary when the predictor is not. The intercept is
removed by differencing at lag
(, ), and the
EL function is built from the score equations
and
,
, with the model error. The weight on
the second equation makes its sample variance converge whether the predictor
is stationary, nearly integrated or a unit root, so that the profile EL
ratios for (no predictability),
and the joint null are , and
without knowing the persistence (Theorem 2). Single predictor only.
el_test(formula, data, na.action) el_test_fit(y, x) ## S3 method for class 'el_test' print(x, digits = max(3L, getOption("digits") - 3L), ...)el_test(formula, data, na.action) el_test_fit(y, x) ## S3 method for class 'el_test' print(x, digits = max(3L, getOption("digits") - 3L), ...)
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
|
na.action |
a function which indicates what should happen when the data
contain NAs. The default is set by the na.action setting of |
y |
response vector. |
x |
an object of class "el_test". |
digits |
minimal number of significant digits. |
... |
unused. |
an object of class "el_test": a list with the EL ratio statistics
stat (named beta2, beta1, joint), their p.value, the
unconstrained EL estimates estimate, the OLS estimates ols of
on the differenced data, and m.
Liu, X., Yang, B., Cai, Z., & Peng, L. (2019). A unified test for predictability of asset returns regardless of properties of predicting variables. Journal of Econometrics, 208(1), 141-159.
Owen, A. B. (2001). Empirical Likelihood. Chapman & Hall.
el_test(Ret ~ DP, data = kms)el_test(Ret ~ DP, data = kms)
elliott_cf runs the augmented predictive regression of Elliott (2011,
eq. 9),
where are user-supplied stationary covariates that are
contemporaneously correlated with the innovations of the persistent
predictors and of the response. If they absorb that correlation
(the "orthogonalising" condition, Section 5 of the paper), the Wald test of
has a standard chi-square limit whatever the persistence of
(Theorem 2); without them it has the non-standard Elliott-Stock
(1994) distribution (Theorem 1). Unlike arm() and ivx_ra(), which build
the control variable from the data, the covariates here come from the user
the paper's example is predicting returns with the dividend-price ratio using contemporaneous price-related variables.
elliott_cf(formula, covariates, data, lags = 0, robust = TRUE, na.action) elliott_cf_fit(y, x, z, lags = 0, robust = TRUE) ## S3 method for class 'elliott_cf' print(x, digits = max(3L, getOption("digits") - 3L), ...)elliott_cf(formula, covariates, data, lags = 0, robust = TRUE, na.action) elliott_cf_fit(y, x, z, lags = 0, robust = TRUE) ## S3 method for class 'elliott_cf' print(x, digits = max(3L, getOption("digits") - 3L), ...)
formula |
an object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted. |
covariates |
a one-sided formula giving the orthogonalising
covariates |
data |
n optional data frame, list or environment (or object coercible by
|
lags |
number of lags |
robust |
logical; if |
na.action |
a function which indicates what should happen when the data
contain NAs. The default is set by the na.action setting of |
y |
response vector. |
x |
an object of class "elliott_cf". |
z |
matrix of covariates. |
digits |
minimal number of significant digits. |
... |
unused. |
The remaining innovation correlation after augmentation is returned as a diagnostic: it is the correlation between the regression residuals and the residuals of an AR(1) of each predictor on the same covariates, and should be close to zero for the test to be reliable.
an object of class "elliott_cf": a list with coefficients (on the
predictors), se, tstat, Wald, df, p.value, gamma (coefficients on
the covariates and their lags), rho_resid (remaining innovation
correlation per predictor) and the underlying lm fit.
Elliott, G. (2011). A control function approach for testing the usefulness of trending variables in predictive regressions and econometric models. Journal of Econometrics, 164(1), 79-91.
Elliott, G., & Stock, J. H. (1994). Inference in time series regression when the order of integration of a regressor is unknown. Econometric Theory, 10(3-4), 672-700.
# the T-bill rate as covariate for the dividend-price ratio (illustration only) elliott_cf(Ret ~ DP, ~ TBL, data = kms)# the T-bill rate as covariate for the dividend-price ratio (illustration only) elliott_cf(Ret ~ DP, ~ TBL, data = kms)
extract method for ivx objectsextract method for ivx objects
extract.ivx( model, include.wald = TRUE, include.nobs = TRUE, include.aic = FALSE, include.bic = FALSE, include.rsquared = FALSE, include.adjrs = FALSE, ... ) extract.ivx_ar( model, include.wald = TRUE, include.nobs = TRUE, include.aic = FALSE, include.bic = FALSE, include.rsquared = FALSE, include.adjrs = FALSE, ... )extract.ivx( model, include.wald = TRUE, include.nobs = TRUE, include.aic = FALSE, include.bic = FALSE, include.rsquared = FALSE, include.adjrs = FALSE, ... ) extract.ivx_ar( model, include.wald = TRUE, include.nobs = TRUE, include.aic = FALSE, include.bic = FALSE, include.rsquared = FALSE, include.adjrs = FALSE, ... )
model |
A statistical model object. |
include.wald |
Report the Wald statistic. |
include.nobs |
Report the number of observations in the GOF block? |
include.aic |
Report Akaike's Information Criterion (AIC) in the GOF block? |
include.bic |
Report the Bayesian Information Criterion (BIC) in the GOF block? |
include.rsquared |
Report the R-squared. |
include.adjrs |
Report the Adjusted R-squared. |
... |
Custom parameters, which are handed over to subroutines. Currently not in use. |
hlt_test implements the double-switching hybrid procedure of
Harvey, Leybourne and Taylor (2021, Section 3.3) for a single predictor.
Two regression t-ratios are used: the standard OLS t-ratio
(eq. 5) and the variant in which the predictor is quasi-GLS
demeaned with (eq. 7). Under weak persistence the standard
t-ratio is compared with normal critical values; under strong persistence
the limiting null distributions depend on the local-to-unity parameter and
on the innovation correlation , and the tests are run with
the paper's asymptotically conservative critical values (maximised over
) obtained from the response surfaces in its Table 1.
hlt_test( formula, data, alternative = c("greater", "less"), level = 0.05, lag_max = NULL, na.action ) hlt_test_fit(y, x, alternative = "greater", level = 0.05, lag_max = NULL) ## S3 method for class 'hlt_test' print(x, digits = max(3L, getOption("digits") - 3L), ...)hlt_test( formula, data, alternative = c("greater", "less"), level = 0.05, lag_max = NULL, na.action ) hlt_test_fit(y, x, alternative = "greater", level = 0.05, lag_max = NULL) ## S3 method for class 'hlt_test' print(x, digits = max(3L, getOption("digits") - 3L), ...)
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
|
alternative |
direction of the one-sided test. |
level |
significance level; one of 0.1, 0.05, 0.025, 0.01 (the levels for which response surfaces are available). |
lag_max |
maximum ADF lag order; the default is the paper's
|
na.action |
a function which indicates what should happen when the data
contain NAs. The default is set by the na.action setting of |
y |
response vector. |
x |
an object of class "hlt_test". |
digits |
minimal number of significant digits. |
... |
unused. |
The procedure is: (1) if the ADF normalised-bias statistic
from an ADF regression with lag
length chosen by the MBIC of Ng and Perron (2001) is below
, the predictor is treated as weakly persistent and the
standard test is used; (2) otherwise, for an upper-tail test,
with critical value if
and with
if (mirrored for lower-tail tests), where
is the correlation of the ADF residuals with the
predictive-regression residuals.
an object of class "hlt_test": a list with the selected test
("T_N", "T_con" or "T~_con"), its statistic, cv and reject
indicator, plus t, t_gls (both t-ratios), adf, adf_lag,
rho_xy and estimate (the OLS slope).
Harvey, D. I., Leybourne, S. J., & Taylor, A. M. R. (2021). Simple tests for stock return predictability with good size and power properties. Journal of Econometrics, 224(1), 198-214.
Ng, S., & Perron, P. (2001). Lag length selection and the construction of unit root tests with good size and power. Econometrica, 69(6), 1519-1554.
hlt_test(Ret ~ DP, data = kms) hlt_test(Ret ~ TBL, data = kms, alternative = "less", level = 0.1)hlt_test(Ret ~ DP, data = kms) hlt_test(Ret ~ TBL, data = kms, alternative = "less", level = 0.1)
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, beta = 0.95, cz = 1, bandwidth = NULL, robust = FALSE, lag_y = FALSE, ... ) ## S3 method for class 'ivx' print(x, digits = max(3L, getOption("digits") - 3L), ...)ivx( formula, data, horizon, na.action, weights, contrasts = NULL, offset, model = TRUE, x = FALSE, y = FALSE, beta = 0.95, cz = 1, bandwidth = NULL, robust = FALSE, lag_y = FALSE, ... ) ## S3 method for class 'ivx' print(x, digits = max(3L, getOption("digits") - 3L), ...)
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). For |
na.action |
a function which indicates what should happen when the data
contain NAs. The default is set by the na.action setting of |
weights |
an optional vector of weights to be used in the fitting process.
Should be |
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", usually, a result of a call to ivx. |
y |
logical. If |
beta, cz
|
tuning parameters of the IVX instrument
|
bandwidth |
Newey-West bandwidth for the long-run covariance estimate.
The default |
robust |
logical. If |
lag_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. |
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. (2015). Robust econometric inference for stock return predictability. The Review of Financial Studies, 28(5), 1506-1553.
Demetrescu, M., Georgiev, I., Rodrigues, P. M. M., & Taylor, A. M. R. (2023). Extensions to IVX methods of inference for return predictability. Journal of Econometrics, 237(2), 105271.
Kostakis, A., Magdalinos, T., & Stamatogiannis, M. P. (2023). Taking stock of long-horizon predictability tests: Are factor returns predictable? Journal of Econometrics, 237(2), 105380.
Demetrescu, M. (2014). Enhancing the local power of IVX-based tests in predictive regressions. Economics Letters, 124(2), 269-273.
# 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) # lag-augmented IVX (Demetrescu, 2014) ivx(Ret ~ DP, data = kms, lag_y = TRUE)# 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) # lag-augmented IVX (Demetrescu, 2014) ivx(Ret ~ DP, data = kms, lag_y = TRUE)
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, beta = 0.95, cz = 1, bandwidth = NULL, robust = FALSE, ... ) ## S3 method for class 'ivx_ar' print(x, digits = max(3L, getOption("digits") - 3L), ...)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, beta = 0.95, cz = 1, bandwidth = NULL, robust = FALSE, ... ) ## S3 method for class 'ivx_ar' print(x, digits = max(3L, getOption("digits") - 3L), ...)
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). For |
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 |
beta, cz
|
tuning parameters of the IVX instrument
|
bandwidth |
Newey-West bandwidth for the long-run covariance estimate.
The default |
robust |
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. |
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) ivx_ar(hpi ~ log(res) + cpi, ylpc, ar_ic = "aic") ivx_ar(hpi ~ log(res) + cpi, ylpc, ar = 1)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)
Basic function called by ivx_ar to fit predictive models.
These should only be used directly by experienced users.
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), beta = 0.95, cz = 1, bandwidth = NULL, robust = FALSE, ... )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), beta = 0.95, cz = 1, bandwidth = NULL, robust = FALSE, ... )
y |
vector of observations of length |
x |
design matrix of dimension |
horizon |
is the horizon (default horizon = 1 corresponds to a
short-horizon regression). For |
offset |
(numeric of length |
ar |
Method to include the autoregressive terms. "auto" find the optimal
ar order by using the information criteria. |
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. |
beta, cz
|
tuning parameters of the IVX instrument
|
bandwidth |
Newey-West bandwidth for the long-run covariance estimate.
The default |
robust |
logical. If |
... |
Further arguments passed to the function which is fitting the best AR model.
If |
ivx_ar_fit(monthly$Ret, as.matrix(monthly$LTY)) ivx_ar_fit(monthly$Ret, as.matrix(monthly$LTY), ar = 1)ivx_ar_fit(monthly$Ret, as.matrix(monthly$LTY)) ivx_ar_fit(monthly$Ret, as.matrix(monthly$LTY), ar = 1)
Computes bootstrap p-values for the IVX Wald and t statistics using the residual wild bootstrap (RWB) or the fixed regressor wild bootstrap (FRWB) of Demetrescu et al. (2023). The null hypothesis of no predictability is imposed on the bootstrap samples. RWB rebuilds the regressor from an AR fit and its residuals (multiplied by the same wild multiplier as the predictive-regression residuals, so the innovation correlation is preserved); FRWB keeps the regressors and instruments fixed and only resamples the response.
ivx_boot( object, B = 999, type = c("rwb", "frwb"), ar_max = 5, dist = c("rademacher", "normal"), seed = NULL, cores = 1L ) ## S3 method for class 'ivx_boot' print(x, digits = max(3L, getOption("digits") - 3L), ...)ivx_boot( object, B = 999, type = c("rwb", "frwb"), ar_max = 5, dist = c("rademacher", "normal"), seed = NULL, cores = 1L ) ## S3 method for class 'ivx_boot' print(x, digits = max(3L, getOption("digits") - 3L), ...)
object |
an object of class "ivx" (not "ivx_ar"), fitted without weights. |
B |
number of bootstrap replications. |
type |
bootstrap scheme: |
ar_max |
maximum lag order of the (vector) autoregression fitted to the regressors by the RWB scheme; the order is selected by BIC (Remark 24). |
dist |
distribution of the wild multipliers. |
seed |
optional integer seed. With |
cores |
number of CPU cores. Uses forking on Unix and a PSOCK cluster on Windows (the package must be installed for the workers to load it). |
x |
an object of class "ivx_boot". |
digits |
minimal number of significant digits. |
... |
further arguments passed to |
an object of class "ivx_boot": a list with the observed statistics,
the bootstrap distributions (boot), and bootstrap p-values (p.value).
p.value$tstat has one column per alternative: two-sided, beta < 0 and
beta > 0.
Demetrescu, M., Georgiev, I., Rodrigues, P. M. M., & Taylor, A. M. R. (2023). Extensions to IVX methods of inference for return predictability. Journal of Econometrics, 237(2), 105271.
mod <- ivx(Ret ~ DP + TBL, data = kms) ivx_boot(mod, B = 199, seed = 1)mod <- ivx(Ret ~ DP + TBL, data = kms) ivx_boot(mod, B = 199, seed = 1)
Tests for "pockets" of predictability using the suprema of sequences of subsample IVX statistics (Demetrescu et al., 2023, Section 3.2; Demetrescu et al., 2022). For each window the IVX statistic is computed from the window's observations with the full-sample instrument (eqs 15-17); the test statistics are the maximum (right-tailed), minimum (left-tailed) and maximum squared (two-sided) t-ratio over the sequence for a single predictor, and the maximum Wald statistic for several predictors (Remark 11). P-values are obtained by wild bootstrap (Algorithms 1-2), which the paper shows to be asymptotically valid for these sup-functionals.
ivx_episodic( object, scheme = c("rolling", "forward", "backward"), window = 0.2, robust = FALSE, B = 999, type = c("frwb", "rwb"), ar_max = 5, dist = c("rademacher", "normal"), seed = NULL, cores = 1L ) ## S3 method for class 'ivx_episodic' print(x, digits = max(3L, getOption("digits") - 3L), ...)ivx_episodic( object, scheme = c("rolling", "forward", "backward"), window = 0.2, robust = FALSE, B = 999, type = c("frwb", "rwb"), ar_max = 5, dist = c("rademacher", "normal"), seed = NULL, cores = 1L ) ## S3 method for class 'ivx_episodic' print(x, digits = max(3L, getOption("digits") - 3L), ...)
object |
an object of class "ivx" fitted with |
scheme |
|
window |
fraction of the sample: the window width for |
robust |
logical; use Eicker-White standard errors in the subsample statistics. |
B |
number of bootstrap replications. |
type |
bootstrap scheme, see |
ar_max |
maximum lag order of the (vector) autoregression fitted to the regressors by the RWB scheme; the order is selected by BIC (Remark 24). |
dist |
distribution of the wild multipliers. |
seed |
optional integer seed. With |
cores |
number of CPU cores. Uses forking on Unix and a PSOCK cluster on Windows (the package must be installed for the workers to load it). |
x |
an object of class "ivx_episodic". |
digits |
minimal number of significant digits. |
... |
unused. |
an object of class "ivx_episodic": the observed sequence
(sequence, one row per window with its start/end index and statistics),
the sup statistics (statistic) and their bootstrap p-values (p.value),
plus the bootstrap draws (boot).
Demetrescu, M., Georgiev, I., Rodrigues, P. M. M., & Taylor, A. M. R. (2022). Testing for episodic predictability in stock returns. Journal of Econometrics, 227(1), 85-113.
Demetrescu, M., Georgiev, I., Rodrigues, P. M. M., & Taylor, A. M. R. (2023). Extensions to IVX methods of inference for return predictability. Journal of Econometrics, 237(2), 105271.
mod <- ivx(Ret ~ DP, data = kms) ivx_episodic(mod, scheme = "rolling", window = 0.2, B = 99, seed = 1)mod <- ivx(Ret ~ DP, data = kms) ivx_episodic(mod, scheme = "rolling", window = 0.2, B = 99, seed = 1)
Basic function called by ivx to fit predictive models.
These should only be used directly by experienced users.
ivx_fit( y, x, horizon = 1, offset = NULL, beta = 0.95, cz = 1, bandwidth = NULL, robust = FALSE, lag_y = FALSE, ... ) ivx_wfit( y, x, w, horizon = 1, offset = NULL, beta = 0.95, cz = 1, bandwidth = NULL, robust = FALSE, lag_y = FALSE, ... )ivx_fit( y, x, horizon = 1, offset = NULL, beta = 0.95, cz = 1, bandwidth = NULL, robust = FALSE, lag_y = FALSE, ... ) ivx_wfit( y, x, w, horizon = 1, offset = NULL, beta = 0.95, cz = 1, bandwidth = NULL, robust = FALSE, lag_y = FALSE, ... )
y |
vector of observations of length |
x |
design matrix of dimension |
horizon |
is the horizon (default horizon = 1 corresponds to a
short-horizon regression). For |
offset |
(numeric of length |
beta, cz
|
tuning parameters of the IVX instrument
|
bandwidth |
Newey-West bandwidth for the long-run covariance estimate.
The default |
robust |
logical. If |
lag_y |
logical. If |
... |
currently disregarded. |
w |
vector of weights (length |
ivx_fit(monthly$Ret, as.matrix(monthly$LTY))ivx_fit(monthly$Ret, as.matrix(monthly$LTY))
ivx_iv implements the instrumental-variable tests of Breitung and
Demetrescu (2015): the predictive regression is estimated by 2SLS with
Eicker-White standard errors (their eq. 12) using instruments that are less
persistent than the predictor. Two families are available. Type-I
instruments are transformations of the predictor itself: the fractional
difference ("frac") and the long difference
("diff"), which keep power when the predictor
is stationary. Type-II instruments are deterministic and correlate with a
near-integrated predictor only: the sine function
("sin"). Their 2SLS combination ("comb", the paper's IVcomb and the
authors' recommendation) is asymptotically dominated by whichever instrument
is informative, so the squared t-ratio (and the Wald statistic with several
predictors) is chi-square whatever the persistence of the predictor
(Theorems 3 and 7).
ivx_iv( formula, data, instruments = c("comb", "sin", "frac", "diff"), d = 0.5, kappa = 0.2, eta = 0.85, na.action, contrasts = NULL, model = TRUE, x = FALSE, y = FALSE, ... ) ## S3 method for class 'ivx_iv' print(x, digits = max(3L, getOption("digits") - 3L), ...)ivx_iv( formula, data, instruments = c("comb", "sin", "frac", "diff"), d = 0.5, kappa = 0.2, eta = 0.85, na.action, contrasts = NULL, model = TRUE, x = FALSE, y = FALSE, ... ) ## S3 method for class 'ivx_iv' print(x, digits = max(3L, getOption("digits") - 3L), ...)
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
|
instruments |
instrument set; see Details. |
d |
order of the fractional difference for |
kappa, eta
|
the long-difference lag is |
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 |
model |
logical. If |
x |
an object of class "ivx_iv". |
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. |
With predictors each type-I instrument is built per predictor and the
sine instruments use frequencies , ,
so that the instrument vector stays linearly independent (Assumption 5).
The IVX instrument of Kostakis et al. (2015) is the paper's "mild
integration" type-I case and is available through ivx().
an object of class c("ivx_iv", "ivx") so the ivx methods apply;
instruments holds the instrument matrix aligned with the regressors.
Breitung, J., & Demetrescu, M. (2015). Instrumental variable and variable addition based inference in predictive regressions. Journal of Econometrics, 187(1), 358-375.
ivx_iv(Ret ~ DP, data = kms) summary(ivx_iv(Ret ~ DP + TBL, data = kms, instruments = "frac"))ivx_iv(Ret ~ DP, data = kms) summary(ivx_iv(Ret ~ DP + TBL, data = kms, instruments = "frac"))
Basic function called by ivx_iv. Should only be used directly by
experienced users.
ivx_iv_fit(y, x, instruments = "comb", d = 0.5, kappa = 0.2, eta = 0.85, ...)ivx_iv_fit(y, x, instruments = "comb", d = 0.5, kappa = 0.2, eta = 0.85, ...)
y |
vector of observations of length |
x |
design matrix of dimension |
instruments |
instrument set; see Details. |
d |
order of the fractional difference for |
kappa, eta
|
the long-difference lag is |
... |
currently unused. |
ivx_iv_fit(kms$Ret, as.matrix(kms$DP))$tstativx_iv_fit(kms$Ret, as.matrix(kms$DP))$tstat
ivx_qr implements the IVX-QR predictability test of Lee (2016): the
-quantile of the response is regressed on the IVX-filtered
predictors (Section 3.3, Proposition 3.2), giving a test of
with a standard chi-square limit whatever the
persistence of the predictors. Requires the quantreg package.
ivx_qr( formula, data, tau = 0.5, beta = 0.95, cz = 5, na.action, contrasts = NULL, model = TRUE, x = FALSE, y = FALSE, ... ) ## S3 method for class 'ivx_qr' print(x, digits = max(3L, getOption("digits") - 3L), ...) ## S3 method for class 'ivx_qr' summary(object, ...)ivx_qr( formula, data, tau = 0.5, beta = 0.95, cz = 5, na.action, contrasts = NULL, model = TRUE, x = FALSE, y = FALSE, ... ) ## S3 method for class 'ivx_qr' print(x, digits = max(3L, getOption("digits") - 3L), ...) ## S3 method for class 'ivx_qr' summary(object, ...)
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
|
tau |
quantile level(s) in (0, 1). A vector fits one model per level. |
beta, cz
|
tuning parameters of the IVX instrument
|
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 |
model |
logical. If |
x |
an object of class "ivx_qr". |
y |
logical. If |
... |
further arguments passed to |
digits |
the number of significant digits to use when printing. |
object |
an object of class "ivx_qr". |
The instrument is . Lee
(2016) normalises and picks from a look-up table
indexed by the estimated QR endogeneity
, which
is returned as rho_tau so the rule can be applied by the user; the default
beta = 0.95 follows Kostakis et al. (2015). The sparsity
is estimated by a Gaussian kernel with Silverman's bandwidth
(footnote 4 of the paper).
For a single tau, an object of class c("ivx_qr", "ivx") (so
summary(), vcov() etc. apply) with components tau, rho_tau,
sparsity () and rq (the underlying quantreg::rq fit).
For several tau, a list of such objects named by tau.
Lee, J. H. (2016). Predictive quantile regression with persistent covariates: IVX-QR approach. Journal of Econometrics, 192(1), 105-118.
if (requireNamespace("quantreg", quietly = TRUE)) { summary(ivx_qr(Ret ~ DP, data = kms, tau = 0.5)) ivx_qr(Ret ~ DP + TBL, data = kms, tau = c(0.1, 0.5, 0.9)) }if (requireNamespace("quantreg", quietly = TRUE)) { summary(ivx_qr(Ret ~ DP, data = kms, tau = 0.5)) ivx_qr(Ret ~ DP + TBL, data = kms, tau = c(0.1, 0.5, 0.9)) }
Percentile confidence intervals and p-values for the IVX-QR coefficients
from the moving block bootstrap (MBB) of Fan and Lee (2019, Section 5).
Blocks of the pairs are resampled and the
quantile regression of Lee (2016) is refitted on each bootstrap sample. This
avoids estimating the sparsity and the nuisance parameters that appear under
conditional heteroskedasticity, which is where the asymptotic IVX-QR test is
most distorted, especially in the tails.
ivx_qr_boot(object, B = 999, block = NULL, level = 0.95, seed = NULL) ## S3 method for class 'ivx_qr_boot' print(x, digits = max(3L, getOption("digits") - 3L), ...)ivx_qr_boot(object, B = 999, block = NULL, level = 0.95, seed = NULL) ## S3 method for class 'ivx_qr_boot' print(x, digits = max(3L, getOption("digits") - 3L), ...)
object |
an object of class "ivx_qr". |
B |
number of bootstrap replications. |
block |
block length; the default is |
level |
confidence level of the percentile intervals. |
seed |
optional integer seed. |
x |
an object of class "ivx_qr_boot". |
digits |
minimal number of significant digits. |
... |
unused. |
an object of class "ivx_qr_boot": a list with the estimates, the
percentile intervals ci, two-sided percentile p-values p.value for
, and the bootstrap draws boot.
Fan, R., & Lee, J. H. (2019). Predictive quantile regressions under persistence and conditional heteroskedasticity. Journal of Econometrics, 213(1), 261-280.
if (requireNamespace("quantreg", quietly = TRUE)) { m <- ivx_qr(Ret ~ DP, data = kms, tau = 0.1) ivx_qr_boot(m, B = 199, seed = 1) }if (requireNamespace("quantreg", quietly = TRUE)) { m <- ivx_qr(Ret ~ DP, data = kms, tau = 0.1) ivx_qr_boot(m, B = 199, seed = 1) }
Basic function called by ivx_qr. Should only be used directly by
experienced users.
ivx_qr_fit(y, x, tau = 0.5, beta = 0.95, cz = 5, ...)ivx_qr_fit(y, x, tau = 0.5, beta = 0.95, cz = 5, ...)
y |
vector of observations of length |
x |
design matrix of dimension |
tau |
quantile level(s) in (0, 1). A vector fits one model per level. |
beta, cz
|
tuning parameters of the IVX instrument
|
... |
currently disregarded. |
if (requireNamespace("quantreg", quietly = TRUE)) { ivx_qr_fit(kms$Ret, as.matrix(kms$DP), tau = 0.5)$Wald_Joint }if (requireNamespace("quantreg", quietly = TRUE)) { ivx_qr_fit(kms$Ret, as.matrix(kms$DP), tau = 0.5)$Wald_Joint }
ivx_ra implements the residual-augmented (bias-reduced) IVX estimator of
Demetrescu and Rodrigues (2022). An autoregression of order p is fitted to
the predictors, the predictive regression is augmented with its residuals
(in the spirit of Amihud and Hurvich, 2004), and the slope on the lagged
predictors is estimated by IVX. Inference uses the heteroskedasticity-robust
standard errors of the paper (eq. 9 and 14), which are valid whether the
predictors are stationary or near-integrated.
ivx_ra( formula, data, ar = "auto", ar_ic = c("aic", "bic"), ar_max = 5, horizon = 1, beta = 0.95, cz = 1, na.action, contrasts = NULL, model = TRUE, x = FALSE, y = FALSE, ... ) ## S3 method for class 'ivx_ra' print(x, digits = max(3L, getOption("digits") - 3L), ...)ivx_ra( formula, data, ar = "auto", ar_ic = c("aic", "bic"), ar_max = 5, horizon = 1, beta = 0.95, cz = 1, na.action, contrasts = NULL, model = TRUE, x = FALSE, y = FALSE, ... ) ## S3 method for class 'ivx_ra' print(x, digits = max(3L, getOption("digits") - 3L), ...)
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
|
ar |
order of the autoregression fitted to the predictors: |
ar_ic |
information criterion for |
ar_max |
maximum order considered when |
horizon |
forecast horizon |
beta, cz
|
tuning parameters of the IVX instrument
|
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 |
model |
logical. If |
x |
an object of class "ivx_ra". |
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. |
For horizon > 1 the estimator is the transformed-regression residual-augmented
IVX of Demetrescu, Rodrigues and Taylor (2023), eqs (4.9), (4.11) and (5.5)-(5.7):
the single-period response is regressed on the -period transformed
instrument
(eq. 4.4), which accounts for the overlap of the long-horizon regression without
HAC estimation. At horizon = 1 it coincides with the short-horizon estimator.
The coefficients estimate the -period slope ; fitted values
and residuals are those of the transformed (non-overlapping) regression, and
the Kostakis et al. (2015) intercept correction is applied only at horizon = 1.
The autoregression of the predictors is fitted without an intercept and its
residuals are demeaned before augmentation, which is the paper's preferred
statistic (Sections 4-5); the standard errors
include the finite-sample correction of Kostakis et al. (2015) as in the
paper's simulations.
an object of class c("ivx_ra", "ivx"); the usual ivx methods
(summary, vcov, delta, ...) apply. Additional components: gamma
(coefficients on the augmentation residuals) and ar_order.
Demetrescu, M., & Rodrigues, P. M. M. (2022). Residual-augmented IVX predictive regression. Journal of Econometrics, 227(2), 429-460.
Demetrescu, M., Rodrigues, P. M. M., & Taylor, A. M. R. (2023). Transformed regression-based long-horizon predictability tests. Journal of Econometrics, 237(2), 105316.
Amihud, Y., & Hurvich, C. M. (2004). Predictive regressions: A reduced-bias estimation method. Journal of Financial and Quantitative Analysis, 39(4), 813-841.
ivx_ra(Ret ~ DP, data = kms) summary(ivx_ra(Ret ~ DP + TBL, data = kms, ar = 2)) # long horizon (Demetrescu, Rodrigues & Taylor, 2023) ivx_ra(Ret ~ DP, data = kms, horizon = 12)ivx_ra(Ret ~ DP, data = kms) summary(ivx_ra(Ret ~ DP + TBL, data = kms, ar = 2)) # long horizon (Demetrescu, Rodrigues & Taylor, 2023) ivx_ra(Ret ~ DP, data = kms, horizon = 12)
Basic function called by ivx_ra to fit the model. Should only be used
directly by experienced users.
ivx_ra_fit( y, x, ar = "auto", ar_ic = "aic", ar_max = 5, horizon = 1, beta = 0.95, cz = 1, ... )ivx_ra_fit( y, x, ar = "auto", ar_ic = "aic", ar_max = 5, horizon = 1, beta = 0.95, cz = 1, ... )
y |
vector of observations of length |
x |
design matrix of dimension |
ar |
order of the autoregression fitted to the predictors: |
ar_ic |
information criterion for |
ar_max |
maximum order considered when |
horizon |
forecast horizon |
beta, cz
|
tuning parameters of the IVX instrument
|
... |
currently unused. |
ivx_ra_fit(kms$Ret, as.matrix(kms$DP))ivx_ra_fit(kms$Ret, as.matrix(kms$DP))
ivx_sys estimates a system of predictive regressions
with an -vector response
and predictors of arbitrary persistence by IVX, and tests linear
restrictions on with the IVX-Wald statistic of Kostakis,
Magdalinos and Stamatogiannis (2023), eqs (15) and (23), whose covariance
has the Kronecker form around
.
Long horizons are handled as in ivx(). For the results
coincide with ivx().
ivx_sys( formula, data, horizon, na.action, contrasts = NULL, model = TRUE, x = FALSE, y = FALSE, beta = 0.95, cz = 1, bandwidth = NULL, ... ) ## S3 method for class 'ivx_sys' print(x, digits = max(3L, getOption("digits") - 3L), ...) ## S3 method for class 'ivx_sys' summary(object, ...)ivx_sys( formula, data, horizon, na.action, contrasts = NULL, model = TRUE, x = FALSE, y = FALSE, beta = 0.95, cz = 1, bandwidth = NULL, ... ) ## S3 method for class 'ivx_sys' print(x, digits = max(3L, getOption("digits") - 3L), ...) ## S3 method for class 'ivx_sys' summary(object, ...)
formula |
a formula whose left-hand side is a matrix, e.g.
|
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). For |
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 |
model |
logical. If |
x |
an object of class "ivx_sys". |
y |
logical. If |
beta, cz
|
tuning parameters of the IVX instrument
|
bandwidth |
Newey-West bandwidth for the long-run covariance estimate.
The default |
... |
additional arguments to be passed to the low level regression fitting functions (see lm). |
digits |
the number of significant digits to use when printing. |
object |
an object of class "ivx_sys". |
an object of class "ivx_sys" with the coefficient matrix
coefficients (responses in rows, predictors in columns), matching se,
tstat and Wald_Ind matrices, the joint Wald statistic Wald_Joint
(), the per-equation Wald statistics Wald_Eq
(), and vcov of vec(coefficients) (column-major, names
response:predictor).
Kostakis, A., Magdalinos, T., & Stamatogiannis, M. P. (2023). Taking stock of long-horizon predictability tests: Are factor returns predictable? Journal of Econometrics, 237(2), 105380.
ivx_sys(cbind(Ret, DE) ~ DP + TBL, data = kms) summary(ivx_sys(cbind(Ret, DE) ~ DP + TBL, data = kms, horizon = 4))ivx_sys(cbind(Ret, DE) ~ DP + TBL, data = kms) summary(ivx_sys(cbind(Ret, DE) ~ DP + TBL, data = kms, horizon = 4))
Basic function called by ivx_sys. Should only be used directly by
experienced users.
ivx_sys_fit(y, x, horizon = 1, beta = 0.95, cz = 1, bandwidth = NULL, ...)ivx_sys_fit(y, x, horizon = 1, beta = 0.95, cz = 1, bandwidth = NULL, ...)
y |
numeric response matrix (observations in rows). |
x |
design matrix of dimension |
horizon |
is the horizon (default horizon = 1 corresponds to a
short-horizon regression). For |
beta, cz
|
tuning parameters of the IVX instrument
|
bandwidth |
Newey-West bandwidth for the long-run covariance estimate.
The default |
... |
currently disregarded. |
ivx_sys_fit(as.matrix(kms[, c("Ret", "DE")]), as.matrix(kms[, c("DP", "TBL")]))ivx_sys_fit(as.matrix(kms[, c("Ret", "DE")]), as.matrix(kms[, c("DP", "TBL")]))
The dataset that was used in Kostakis et al (2015), containing a range of financial variables.
Date: year-month-date (monthly frequency)
DE: dividend payout ratio
LTY: long-term yield
DY: dividend yield
DP: dividend-price ratio
TBL: T-bill rate
EP: earnings-price ratio
BM: book-to-market value ratio
INF: inflation rate
DFY: default yield spread
NTIS: net equity expansion
TMS: term spread
Ret: S&P 500 value-weighted log excess returns
kmskms
A data.frame with 13 variables and 1,033 observations.
https://drive.google.com/open?id=1FdT2STHO2Lnlweom4AwICVf-rpVMfgV4
The dataset that was used in Kostakis et al (2015), containing a range of financial variables.
Date: year-month-date
DE: dividend payout ratio
LTY: long-term yield
DY: dividend yield
DP: dividend-price ratio
TBL: T-bill rate
EP: earnings-price ratio
BM: book-to-market value ratio
INF: inflation rate
DFY: default yield spread
NTIS: net equity expansion
TMS: term spread
Ret: S&P 500 value-weighted log excess returns
kms_quarterlykms_quarterly
A data.frame with 13 variables and 345 observations.
https://drive.google.com/open?id=1FdT2STHO2Lnlweom4AwICVf-rpVMfgV4
summary method for class "ivx".
## S3 method for class 'ivx' summary(object, ...) ## S3 method for class 'summary.ivx' print( x, digits = max(3L, getOption("digits") - 3L), signif.stars = getOption("show.signif.stars"), ... )## S3 method for class 'ivx' summary(object, ...) ## S3 method for class 'summary.ivx' print( x, digits = max(3L, getOption("digits") - 3L), signif.stars = getOption("show.signif.stars"), ... )
object |
object of class "ivx", usually, a result of a call to ivx. |
... |
further arguments passed to or from other methods. |
x |
an object of class |
digits |
the number of significant digits to use when printing. |
signif.stars |
logical. If |
mod <- ivx(Ret ~ LTY, data = monthly) summary(mod)mod <- ivx(Ret ~ LTY, data = monthly) summary(mod)
summary method for class "ivx".
## S3 method for class 'ivx_ar' summary(object, ...) ## S3 method for class 'summary.ivx_ar' print( x, digits = max(3L, getOption("digits") - 3L), signif.stars = getOption("show.signif.stars"), ... )## S3 method for class 'ivx_ar' summary(object, ...) ## S3 method for class 'summary.ivx_ar' print( x, digits = max(3L, getOption("digits") - 3L), signif.stars = getOption("show.signif.stars"), ... )
object |
object of class "ivx_ar", usually, a result of a call to ivx_ar. |
... |
further arguments passed to or from other methods. |
x |
an object of class |
digits |
the number of significant digits to use when printing. |
signif.stars |
logical. If |
mod <- ivx_ar(Ret ~ LTY, data = kms) summary(mod)mod <- ivx_ar(Ret ~ LTY, data = kms) summary(mod)
Calculate Variance-Covariance Matrix for a Fitted Model Object
## S3 method for class 'ivx' vcov(object, complete = TRUE, ...) ## S3 method for class 'summary.ivx' vcov(object, complete = TRUE, ...)## S3 method for class 'ivx' vcov(object, complete = TRUE, ...) ## S3 method for class 'summary.ivx' vcov(object, complete = TRUE, ...)
object |
a fitted ivx and summary.ivx object. |
complete |
logical indicating if the full variance-covariance matrix should be returned. When complete = TRUE, vcov() is compatible with coef(). |
... |
additional arguments for method functions. |
A matrix of the estimated covariances between the parameter estimates of the model. This should have row and column names corresponding to the parameter names given by the coef method.
mod <- ivx(Ret ~ LTY, data = monthly) vcov(mod)mod <- ivx(Ret ~ LTY, data = monthly) vcov(mod)
The dataset that was used in ..., containing a range of variables.
ylpcylpc
An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 174 rows and 12 columns.
Yang, B., Long, W., Peng, L., and Cai, Z. (2020). Autoregressive-model-based inference for predictive regressions with persistent predictors. Journal of the American Statistical Association, 115(530), 1029-1039. DOI: 10.1080/01621459.2019.1686392