--- title: "IVX quantile predictive regression" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{IVX quantile predictive regression} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r, include = FALSE} knitr::opts_chunk$set(collapse = TRUE, comment = "#>") has_qr <- requireNamespace("quantreg", quietly = TRUE) ``` ```{r setup, message = FALSE} library(ivx) ``` `ivx_qr()` implements the IVX-QR predictability test of Lee (2016): a quantile regression version of the IVX test that is valid for stationary, mildly integrated, near-unit-root and mildly explosive predictors alike. It needs the **quantreg** package. ## Setting The conditional $\tau$-quantile of the return is modelled as $$ Q_{y_t}(\tau \mid x_{t-1}) = \beta_{0,\tau} + \beta_\tau' x_{t-1}. $$ Ordinary quantile regression on $x_{t-1}$ suffers from the same problem as OLS: with persistent, endogenous predictors the QR t-ratio has a non-standard limit that depends on the local-to-unity parameter and on the quantile-specific endogeneity $\rho(\tau) = -\mathrm{corr}\big(1\{u_{0t} < 0\}, u_{xt}\big)$. ## The test Lee's practical procedure (Section 3.3, Proposition 3.2) exploits that the IVX instrument $z_{t-1}$ is "close" to $x_{t-1}$: run the quantile regression of $y_t$ on an intercept and the demeaned instrument, $$ \hat\beta^{IVXQR}_\tau = \arg\min_{\beta_0, \beta} \sum_t \rho_\tau\big( y_t - \beta_0 - \beta' \tilde z_{t-1} \big), $$ and use the self-normalised statistic $$ \frac{\hat f_u(0)^2}{\tau(1-\tau)} \; \hat\beta_\tau' \Big(\sum_t \tilde z_{t-1} \tilde z_{t-1}'\Big) \hat\beta_\tau \;\to\; \chi^2_K \quad \text{under } H_0: \beta_\tau = 0, $$ where $\hat f_u(0)$ is the density of the QR residuals at zero, estimated with a Gaussian kernel and Silverman's bandwidth (the paper's footnote 4). The implied covariance $\tau(1-\tau)\hat f_u(0)^{-2}(\tilde Z'\tilde Z)^{-1}$ gives the standard errors in `summary()`. ```{r, eval = has_qr} m <- ivx_qr(Ret ~ DP, data = kms, tau = 0.5) summary(m) ``` Several quantiles at once return a list: ```{r, eval = has_qr} ms <- ivx_qr(Ret ~ DP + TBL, data = kms, tau = c(0.1, 0.25, 0.5, 0.75, 0.9)) t(sapply(ms, function(f) c(tau = f$tau, coef(f), Wald = round(f$Wald_Joint, 2), p = round(1 - pchisq(f$Wald_Joint, 2), 3)))) ``` Predictability that is absent at the median can appear in the tails, which is the empirical point of the paper. ## Tuning Lee normalises $c_z = 5$ (the package default for `ivx_qr()`; `ivx()` uses 1) and chooses the exponent $\beta$ from a look-up table indexed by the estimated endogeneity $\hat\rho(\tau)$, so that the asymptotic size of the nominal 5% test stays below 7.5%: the larger $|\hat\rho(\tau)|$, the smaller $\beta$. The table is in the paper's supplement rather than the paper, so the package reports $\hat\rho(\tau)$ (`rho_tau`, also printed by `summary()`) and leaves `beta` to the user, defaulting to the Kostakis et al. (2015) value 0.95. In a Monte Carlo with a unit-root predictor and $\rho = -0.95$ the median test with the default has empirical size of about 8% at $n = 250$, which is exactly the situation the rule is meant to correct; with $\beta = 0.8$: ```{r, eval = has_qr} ivx_qr(Ret ~ DP, data = kms, tau = 0.5, beta = 0.8)$Wald_Joint ``` ## Block bootstrap under conditional heteroskedasticity The asymptotic test needs the sparsity $f_u(0)$ and, with conditionally heteroskedastic errors, further nuisance parameters that enter the limit (Fan & Lee, 2019, Theorem 3.2); their estimation error is what distorts the test in the tails. `ivx_qr_boot()` implements the paper's moving block bootstrap: blocks of the pairs $(y_t, \tilde z_{t-1})$ of length $\lceil n^{1/4} \rceil$ are resampled, the quantile regression is refitted, and percentile intervals and p-values are reported. No sparsity estimate is needed. ```{r} m <- ivx_qr(Ret ~ DP + TBL, data = kms, tau = 0.1) ivx_qr_boot(m, B = 499, seed = 1) ``` In the paper's ARCH(1) design ($\alpha_1 = 0.9$, $\rho = -0.9$, $c = 0$, $n = 200$, $\tau = 0.1$) the asymptotic test rejects a true null 18% of the time in 300 replications; the block bootstrap 7%. ## Caveats * Tail quantiles need long samples for an accurate density estimate; the paper uses $n = 700$ to study the 5% quantile. * The test in `summary()` is the QR-on-instrument test of Proposition 3.2, not the full IVX-QR estimator of the paper's equation (3.6), whose non-convex objective the paper itself avoids for testing $\beta_\tau = 0$. The coefficients are therefore those of the regression on $\tilde z_{t-1}$. * Short horizon only. `ivx_boot()` does not apply; use `ivx_qr_boot()`. * The `rq` fit is stored in the result (`$rq`) for further quantreg methods. ## References * Fan, R., & Lee, J. H. (2019). Predictive quantile regressions under persistence and conditional heteroskedasticity. *Journal of Econometrics*, 213(1), 261–280. * Lee, J. H. (2016). Predictive quantile regression with persistent covariates: IVX-QR approach. *Journal of Econometrics*, 192(1), 105–118. * Koenker, R. (2005). *Quantile Regression*. Cambridge University Press.