Package 'qadf'

Title: Quantile Autoregressive Distributed Lag Unit Root Test
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.
Authors: Muhammad Alkhalaf [aut, cre, cph] (ORCID: <https://orcid.org/0009-0002-2677-9246>)
Maintainer: Muhammad Alkhalaf <[email protected]>
License: GPL-3
Version: 1.0.2
Built: 2026-10-09 11:40:20 UTC
Source: https://github.com/muhammedalkhalaf/qadf

Help Index


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,

Qyt(τ)=α0(τ)+ρ(τ)yt−1+∑j=1pαj(τ)Δyt−j,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 pp is chosen from the ADF regression on a common sample. The statistic is equation (9) of Koenker and Xiao (2004),

tn(τ)=f^(F−1(τ))τ(1−τ)(Y−1′PXY−1)1/2(ρ^(τ)−1),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 PXP_X projects off the other regressors and the density is estimated by the difference quotient of the fitted conditional quantile at τ±h\tau \pm h with the Hall-Sheather bandwidth hh. It tests H0:ρ(τ)=1H_0: \rho(\tau) = 1 against H1:ρ(τ)<1H_1: \rho(\tau) < 1.

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

Value

An object of class "qadf" with components:

statistic

The QADF t-statistic tn(τ)t_n(\tau).

coef_stat

The Un(τ)=n(ρ^(τ)−1)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 α^0(τ)\hat\alpha_0(\tau).

delta2

Nuisance parameter δ^2\hat\delta^2, the squared correlation between Δyt\Delta y_t and ψτ(u^t)\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 δ^2\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)