*! version 1.0.0 09jul2026

Title

urvol -- Unit-root tests robust to non-stationary (time-varying) volatility

Syntax

urvol subcommand varname [if] [in] , [options]

subcommand

wbdf wild-bootstrap (augmented) Dickey-Fuller / Phillips-Perron test

beare Beare (2017) kernel-rescaled Phillips-Perron test

bzu Boswijk & Zu (2018) adaptive wild-bootstrap likelihood-ratio test

all run the three tests and print a comparison table

varname must be a single time series that has been tsset. The data
must not be xtset as a panel.

Description

urvol implements a family of unit-root tests designed to remain valid, and
to gain power, when the innovation variance is not constant over the sample
-the "unstable" or "non-stationary" volatility case. Permanent
changes in variance (level shifts, trends in variance, smooth transitions,
integrated volatility) are pervasive in macroeconomic and financial time series
(exchange rates, interest rates, output, asset prices). As Cavaliere (2004)
shows, such variance dynamics make the standard Dickey-Fuller (DF) and
Phillips-Perron (PP) tests size-distorted: an early negative or late
positive variance change can push the empirical rejection frequency well above
(or below) the nominal level, invalidating the usual critical values.

The reference data-generating process is the heteroskedastic first-order
autoregression

X(t) = alpha X(t-1) + u(t),

u(t) = sigma(t) e(t),

where the variance profile obeys sigma([sT]) = omega(s) for a bounded,
square-integrable function omega(.) with finitely many jumps (Cavaliere
2004, Assumption V). Under this profile the DF statistic converges to a functional
of a variance-transformed Brownian motion rather than a standard Brownian
motion - which is exactly why the classical tables fail. The three
urvol subcommands are the three leading remedies in the literature.

The three tests

wbdf Wild-bootstrap (A)DF/PP (Cavaliere & Taylor 2008, 2009).
Computes the usual (A)DF t- or coefficient statistic, then obtains its
p-value from a wild bootstrap that reproduces the sample volatility
pattern. Corrects the size distortion of DF/PP but does not reweight the data,
so power is similar to DF. The robust baseline.

beare Rescaled Phillips-Perron (Beare 2017).
Rescales the increments by a Nadaraya-Watson kernel estimate of the
volatility path, omega-hat(s/n), and applies a PP test to the cumulated,
rescaled series. In the constant-mean case the rescaled statistic recovers the
standard DF/PP null distribution, so ordinary critical values apply.

bzu Adaptive wild-bootstrap LR (Boswijk & Zu 2018).
Non-parametrically estimates the volatility path sigma-hat(t) (double-sided
exponential kernel, window chosen by cross-validation), forms a
variance-weighted GLS-detrended likelihood-ratio statistic that attains the
Gaussian power envelope, and gets its p-value from the wild bootstrap.
The most powerful member under non-stationary volatility.

All three share the null H0: a unit root (alpha = 1) and are lower-tailed
(reject for large negative statistics). See dfuller, pperron
and dfgls for the classical, homoskedastic counterparts.

Common options

trend includes a constant and a linear trend in the deterministic component
(the default is a constant only); noconstant removes the constant.

reps(#) sets the number of bootstrap replications (default 999).

seed(#) sets the random-number seed for reproducibility of the bootstrap.

Subcommand-specific options (lag order, kernel bandwidth, volatility window,
GLS constant, graphing) are documented on the individual help pages linked above.

Examples

Set up a single time series:

. webuse wpi1

. tsset t

Run the whole family at once:

. urvol all ln_wpi, trend

Individual tests with graphs:

. urvol wbdf ln_wpi, trend reps(999) graph

. urvol beare ln_wpi, trend bandwidth(0.1) graph

. urvol bzu ln_wpi, trend graph

A financial series with obvious volatility clustering:

. webuse sp500

. gen t = _n

. tsset t

. gen lclose = ln(close)

. urvol all lclose

Stored results

Each subcommand is rclass and returns its statistic and bootstrap
p-value; see the individual help pages for the full list. urvol all
additionally returns:

Matrices

r(results) 3 x 2 matrix of (statistic, p-value) for wbdf/beare/bzu

Scalars

r(p_wbdf), r(p_beare), r(p_bzu) bootstrap p-values

References

Beare, B. K. 2017. Unit root testing with unstable volatility.
Journal of Time Series Analysis 39(6): 816-835.
doi:10.1111/jtsa.12279.

Boswijk, H. P., and Y. Zu. 2018. Adaptive wild bootstrap tests for a unit root
with non-stationary volatility. Econometrics Journal 21(2): 87-113.
doi:10.1111/ectj.12100.

Cavaliere, G. 2004. Unit root tests under time-varying variances.
Econometric Reviews 23(3): 259-292.
doi:10.1081/ETC-200028215.

Cavaliere, G., and A. M. R. Taylor. 2008. Bootstrap unit root tests for time
series with non-stationary volatility. Econometric Theory 24(1): 43-71.

Cavaliere, G., and A. M. R. Taylor. 2009. Heteroskedastic time series with a
unit root. Econometric Theory 25(5): 1228-1276.

Elliott, G., T. J. Rothenberg, and J. H. Stock. 1996. Efficient tests for an
autoregressive unit root. Econometrica 64(4): 813-836.

Author

Dr Merwan Roudane

merwanroudane920@gmail.com

https://github.com/merwanroudane