Package {qadf}


Type: Package
Title: Quantile Autoregressive Distributed Lag Unit Root Test
Version: 1.0.2
Description: Implements the Quantile Autoregressive Distributed Lag (QADF) unit root test proposed by Koenker and Xiao (2004) <doi:10.1198/016214504000001114>. The test examines unit root behaviour across the conditional distribution of a time series using quantile regression, providing a richer characterisation of persistence than standard ADF tests. Critical values follow Hansen (1995) <doi:10.1017/S0266466600009993>. Lag order selection is supported via AIC, BIC, or the t-statistic sequential testing approach.
License: GPL-3
Encoding: UTF-8
RoxygenNote: 7.3.2
Depends: R (≥ 3.5.0)
Imports: stats, quantreg
Suggests: testthat (≥ 3.0.0)
Config/testthat/edition: 3
URL: https://github.com/muhammedalkhalaf/qadf
BugReports: https://github.com/muhammedalkhalaf/qadf/issues
NeedsCompilation: no
Packaged: 2026-09-28 15:19:49 UTC; root
Author: Muhammad Alkhalaf ORCID iD [aut, cre, cph]
Maintainer: Muhammad Alkhalaf <muhammedalkhalaf@gmail.com>
Repository: CRAN
Date/Publication: 2026-09-30 21:20:37 UTC

Print and Summary Methods for qadf Objects

Description

Print and summary methods for objects of class "qadf" returned by qadf.

Usage

## S3 method for class 'qadf'
print(x, digits = 4L, ...)

## S3 method for class 'qadf'
summary(object, ...)

Arguments

x

An object of class "qadf".

digits

Integer. Number of significant digits for display.

...

Further arguments (ignored).

object

An object of class "qadf".

Value

Invisibly returns the input object.

Examples

set.seed(1)
y <- cumsum(rnorm(80))
res <- qadf(y, tau = 0.5)
print(res)
summary(res)

Quantile ADF Unit Root Test

Description

Implements the Quantile Autoregressive Distributed Lag (QADF) unit root test of Koenker and Xiao (2004). The test examines unit root behaviour across quantiles of the conditional distribution of a time series using quantile regression.

Usage

qadf(x, tau = 0.5, model = "c", max_lags = 8, ic = "aic")

Arguments

x

A numeric vector or univariate time series object.

tau

A numeric scalar specifying the quantile at which to estimate the model. Must satisfy 0 < tau < 1. Default is 0.5.

model

A character string specifying the deterministic component. "c" (default) includes a constant; "ct" includes a constant and a linear trend.

max_lags

A non-negative integer specifying the maximum number of augmentation lags to consider. Default is 8.

ic

A character string for the information criterion used to select the optimal lag length. One of "aic" (default), "bic", or "tstat" (largest lag whose last coefficient is significant at the 5% level).

Details

The quantile autoregression is estimated in levels,

Q_{y_t}(\tau) = \alpha_0(\tau) + \rho(\tau) y_{t-1} + \sum_{j=1}^{p} \alpha_j(\tau) \Delta y_{t-j},

with a linear trend added for model = "ct". The lag order p is chosen from the ADF regression on a common sample. The statistic is equation (9) of Koenker and Xiao (2004),

t_n(\tau) = \frac{\hat f(F^{-1}(\tau))}{\sqrt{\tau(1-\tau)}} (Y_{-1}' P_X Y_{-1})^{1/2} (\hat\rho(\tau) - 1),

where P_X projects off the other regressors and the density is estimated by the difference quotient of the fitted conditional quantile at \tau \pm h with the Hall-Sheather bandwidth h. It tests H_0: \rho(\tau) = 1 against H_1: \rho(\tau) < 1.

The limiting distribution depends on \delta^2; the critical values are those of Hansen (1995) for the covariate augmented Dickey-Fuller test, linearly interpolated on the grid \delta^2 = 0.1, \ldots, 1.

Value

An object of class "qadf" with components:

statistic

The QADF t-statistic t_n(\tau).

coef_stat

The U_n(\tau) = n(\hat\rho(\tau) - 1) statistic.

rho_tau

Quantile autoregressive coefficient \hat\rho(\tau).

rho_ols

OLS autoregressive coefficient.

alpha_tau

Quantile intercept \hat\alpha_0(\tau).

delta2

Nuisance parameter \hat\delta^2, the squared correlation between \Delta y_t and \psi_\tau(\hat u_t); it indexes the critical values.

half_life

Half-life implied by \hat\rho(\tau), in periods.

opt_lags

Selected lag order.

nobs

Number of observations used.

critical_values

Named numeric vector of critical values at 1%, 5%, and 10% from Hansen (1995), interpolated in \hat\delta^2.

tau

The quantile used.

model

The deterministic model used.

ic

The information criterion used.

varname

The name of the input series.

References

Koenker, R. and Xiao, Z. (2004). Unit Root Quantile Autoregression Inference. Journal of the American Statistical Association, 99(465), 775–787. doi:10.1198/016214504000001114

Hansen, B. E. (1995). Rethinking the Univariate Approach to Unit Root Tests: How to Use Covariates to Increase Power. Econometric Theory, 11(5), 1148–1171. doi:10.1017/S0266466600009993

Examples

set.seed(42)
y <- cumsum(rnorm(100))
result <- qadf(y, tau = 0.5, model = "c", max_lags = 4)
print(result)