*! version 1.0.0 02Feb2026

Title

boundedur -- Unit root tests for bounded time series

Syntax

boundedur
varname
[if] [in]
,
lbound(#)
[options]

Main
* lbound(#) lower bound value

ubound(#) upper bound value; default is infinity (one-sided bound)

test(string) test type: adf, adfalpha, adft, mzalpha, mzt, msb, or all; default is all

Lag selection
lags(#) number of lags for ADF regression; default is automatic selection using MAIC

maxlag(#) maximum lag for MAIC selection; default is 12*(T/100)^0.25

Simulation
nsim(#) number of Monte Carlo replications; default is 499

nstep(#) discretization steps for simulated process; default is T

recolor apply re-coloring device to MC innovations

krclag(#) lags for re-coloring AR polynomial; default equals lags()

nosimulation compute test statistics only, no p-values

seed(#) set random number seed

Reporting
level(#) set confidence level; default is level(95)

detrend(string) detrending method: constant or none; default is constant

* lbound(#) is required.

Time-series operators are allowed; see tsvarlist.

Data must be tsset; see tsset.

Description

boundedur implements unit root tests for bounded time series as developed by
Cavaliere and Xu (2014). Many economic and financial series are bounded either by construction
(e.g., interest rates, unemployment rates) or through policy controls (e.g., target zone
exchange rates). Conventional unit root tests (ADF, Phillips-Perron) are unreliable in the
presence of bounds, as they tend to over-reject the null hypothesis of a unit root, even
asymptotically.

This package implements:

• Augmented Dickey-Fuller (ADF) tests: ADF_alpha and ADF_t

• Modified M tests (Ng & Perron, 2001): MZ_alpha, MZ_t, and MSB

• Simulation-based p-values that account for bound effects

• Optional re-coloring device for improved finite sample performance

The tests are based on a simulation approach that uses consistent estimators of the bound
parameters to generate the appropriate null distribution via Monte Carlo methods. The
implementation follows Algorithm 1 in Cavaliere and Xu (2014) exactly.

Options

Main

lbound(#) specifies the lower bound. This is required. The variable values
must be greater than or equal to this bound.

ubound(#) specifies the upper bound. If not specified, the test assumes
a one-sided bound (lower bound only). When specified, the variable values must
be less than or equal to this bound.

test(string) specifies which test(s) to compute:

adf - both ADF_alpha and ADF_t

adfalpha - ADF_alpha statistic only

adft - ADF_t statistic only

mzalpha - MZ_alpha statistic only

mzt - MZ_t statistic only

msb - MSB statistic only

all - all tests (default)

Lag selection

lags(#) specifies the number of lags to include in the ADF regression.
If not specified, the optimal lag length is selected automatically using the
Modified Akaike Information Criterion (MAIC) of Ng and Perron (2001).

maxlag(#) specifies the maximum lag length to consider when using MAIC
selection. The default is 12*(T/100)^0.25 as recommended by Ng and Perron (2001).

Simulation

nsim(#) specifies the number of Monte Carlo replications used to compute
p-values. The default is 499. Larger values (e.g., 999 or 4999) provide more
accurate p-values but increase computation time.

nstep(#) specifies the number of discretization steps n used to approximate
the continuous-time regulated Brownian motion. The default is T (sample size),
which the paper shows provides better finite sample performance than n=20,000.

recolor applies the re-coloring (sieve bootstrap) device described in
Section 4.3 of the paper. This improves finite sample performance when errors
are serially correlated. Highly recommended for practical applications.

krclag(#) specifies the number of lags used in the AR polynomial for
the re-coloring device. The default equals the value specified in lags().

nosimulation computes only the test statistics without simulation-based
p-values. This provides the standard (possibly oversized) test statistics.

seed(#) sets the random number seed for reproducible results.

Reporting

level(#) specifies the confidence level for displaying test decisions.
The default is level(95).

detrend(string) specifies how to remove deterministic components:

constant - removes sample mean (default)

none - no detrending

Examples

Setup

. webuse lutkepohl

. tsset qtr

Test for unit root with lower bound at 0 (e.g., interest rate)

. boundedur investment, lbound(0)

Test with two bounds

. boundedur investment, lbound(2) ubound(10)

Specify lag length manually

. boundedur investment, lbound(0) lags(4)

Use re-coloring for better finite sample performance

. boundedur investment, lbound(0) recolor

Run only ADF_t test with more simulations

. boundedur investment, lbound(0) test(adft) nsim(999)

Compute test statistics without simulation

. boundedur investment, lbound(0) nosimulation

US 3-month Treasury Bill example from paper

. * Load US T-bill data

. use "us_tbill_data.dta", clear

. tsset time

. boundedur tbill, lbound(0) recolor

Stored results

boundedur stores the following in r():

Scalars

r(N) number of observations

r(lags) number of lags used

r(c_lower) estimated lower bound parameter

r(c_upper) estimated upper bound parameter

r(sigma2_lr) long-run variance estimate

r(lbound) specified lower bound

r(ubound) specified upper bound

r(adf_alpha) ADF_alpha test statistic

r(pval_adf_alpha) p-value for ADF_alpha

r(adf_t) ADF_t test statistic

r(pval_adf_t) p-value for ADF_t

r(mz_alpha) MZ_alpha test statistic

r(pval_mz_alpha) p-value for MZ_alpha

r(mz_t) MZ_t test statistic

r(pval_mz_t) p-value for MZ_t

r(msb) MSB test statistic

r(pval_msb) p-value for MSB

Macros

r(depvar) dependent variable name

r(timevar) time variable name

r(detrend) detrending method

Matrices

r(results) matrix of test statistics and p-values

References

Cavaliere, G., and F. Xu. 2014. Testing for unit roots in bounded time series.
Journal of Econometrics 178: 259-272.

Ng, S., and P. Perron. 2001. LAG length selection and the construction of unit root
tests with good size and power. Econometrica 69: 1519-1554.

Phillips, P. C. B., and P. Perron. 1988. Testing for a unit root in time series
regressions. Biometrika 75: 335-346.

Author

Dr. Merwan Roudane

Independent Researcher

Email: merwanroudane920@gmail.com

Also see

Online: dfuller, pperron, dfgls