*! version 1.0.0 20jul2026

Title

bootur methods -- Methodology and step-to-equation map for bootur

Model and hypotheses

For a series y(t) the augmented Dickey-Fuller (ADF) regression is

d.y(t) = gamma*y(t-1) + sum_ phi(j)*d.y(t-j) + d(t)'beta + e(t),

where d(t) collects the deterministic terms. The unit root null is
H0: gamma = 0 (a unit root; the largest autoregressive root equals one)
against the stationary alternative Ha: gamma < 0. The reported
"estimate of the largest root" is 1 + gamma^hat.

ADF test statistic

The test statistic is the usual t-ratio on gamma^hat. Following Palm, Smeekes
and Urbain (2008), the bootstrap is a residual (under-the-alternative)
bootstrap: the model above is estimated on the observed data and two residual
series are retained -- the full residuals e^hat(t) (used for the sieve
schemes) and the restricted residuals under the null,
eb(t) = d.y(t) - gamma^hat*y(t-1) (used as the increments for the
resampling and wild schemes).

Detrending (OLS and QD)

Two-step detrending removes the deterministic component before running the ADF
regression. With detrend(OLS) the terms are removed by ordinary least
squares; with detrend(QD) by quasi-differencing at the local-to-unity
point cbar/T (Elliott, Rothenberg and Stock, 1996), with cbar = 7 for an
intercept and cbar = 13.5 for an intercept and trend. detrend(OLS) gives
the standard ADF test and detrend(QD) the DF-GLS test. The adf
subcommand also offers one-step detrending (onestep), in which the
deterministic terms enter the regression directly.

Lag length selection

The lag order p is chosen between minlag() and maxlag() by an
information criterion: AIC, BIC, or the modified criteria
MAIC/MBIC of Ng and Perron (2001) with the Perron and Qu (2008)
correction (all lags are evaluated on a common sample). With scale(1)
the criteria are rescaled for nonstationary volatility using the
Nadaraya-Watson variance estimator of Cavaliere et al. (2015). Setting
minlag() equal to maxlag() fixes the lag length. The default
maxlag() follows a Schwert-type rule with a small-sample correction.

Bootstrap schemes

Let l be the block length. The bootstrap builds a pseudo series by cumulating
resampled or reweighted increments:

MBB - moving-block bootstrap: resample blocks of the
increments (Paparoditis and Politis, 2003; Palm, Smeekes and Urbain, 2011).

BWB - block wild bootstrap: multiply blocks by i.i.d.
N(0,1) draws (Shao, 2011; Smeekes and Urbain, 2014).

DWB - dependent wild bootstrap: multiply by a Gaussian
vector with the trapezoidal self-convolution covariance (Shao, 2010; Rho and
Shao, 2019). The weight matrix is the matrix square root of that covariance,
with eigenvalues floored at 1e-10 and eigenvectors sign-normalised for
cross-platform reproducibility.

AWB - autoregressive wild bootstrap (default): an AR(1)
wild sequence with parameter ar = 0.01^(1/l) (Smeekes and Urbain, 2014;
Friedrich, Smeekes and Urbain, 2020).

SB/SWB - sieve and sieve-wild bootstraps: regenerate
the increments through the fitted AR filter using resampled (SB) or
wild-reweighted (SWB) sieve residuals (Chang and Park, 2003; Cavaliere and
Taylor, 2009; Smeekes and Taylor, 2012).

Every bootstrap replication recomputes the entire statistic, including the
information-criterion lag selection, so the bootstrap distribution reflects the
selection uncertainty of the observed statistic (this is essential for correct
size).

Union test

The union statistic is the minimum, over the four combinations of deterministic
component (intercept; intercept and trend) and detrending (OLS; QD), of the
individual statistics each scaled by its own bootstrap quantile at the level
level() (Harvey, Leybourne and Taylor, 2012; Smeekes and Taylor, 2012).
No deterministic specification need be chosen.

Multiple-testing control

fdr implements the step-down procedure controlling the false discovery
rate (Moon and Perron, 2012; Romano, Shaikh and Wolf, 2008): critical values
are built from the ordered bootstrap statistics so that the expected proportion
of false rejections is bounded by level(). sqt implements the
bootstrap sequential quantile test (Smeekes, 2015): groups of series defined by
steps() are tested in sequence until the first non-rejection; with unit
steps this is the StepM procedure of Romano and Wolf (2005). panel averages
the individual statistics into the group-mean statistic and compares it with the
bootstrap distribution of the average.

Step-to-equation map

This Stata port reproduces the R package bootUR routine by routine.

bu_adf_fit ADF regression; t- and normalised statistics

bu_detrend OLS / QD (GLS) detrending

bu_ic, bu_selectlags AIC/BIC/MAIC/MBIC lag selection

bu_rescale, bu_npve nonstationary-volatility rescaling

bu_dgp_panel residual bootstrap DGP

bu_boot_dgp MBB/BWB/DWB/AWB/SB/SWB pseudo series

bu_dwb_s DWB self-convolution weight matrix

bu_scaling, bu_union union scaling and statistic

bu_iadf bootstrap p-values

bu_fdr false-discovery-rate step-down

bu_bsqt sequential quantile test

bu_fpval MacKinnon (1996) asymptotic p-value

The deterministic parts (ADF statistics, gamma estimates, selected lags and the
MacKinnon p-values) reproduce the R output to machine precision; the bootstrap
p-values are Monte Carlo estimates and therefore differ only by simulation
noise for a given random-number seed.

Author

Dr Merwan Roudane - merwanroudane920@gmail.com -
github.com/merwanroudane