*! version 1.0.0 07jul2026 Merwan Roudane

Title

boundeduroot mtests -- GLS-based M unit-root tests for bounded series (CSG 2013)

Syntax

boundeduroot mtests varname [if] [in],
lbound(#) ubound(#)
[options]

lbound(#) lower bound b (required; . = one-sided)

ubound(#) upper bound b-bar (required; . = one-sided)

iter(#) Monte Carlo draws for the simulated critical values; default 1000

maxlag(#) maximum lag for MAIC / spectral AR LRV; default floor(12*(T/100)^.25)

seed(#) RNG seed for the critical-value simulation; default 16384

level(#) significance level of the reported critical value; default c(level)

nograph suppress the diagnostic figure

gname(string) name stub for the produced graphs

Description

boundeduroot mtests computes the modified "M" unit-root tests
(MSB, MZ{&alpha}, MZt) of Perron-Ng / Ng-Perron (2001) for a bounded
series, under three detrending schemes crossed with two long-run variance (LRV) estimators,
giving six configurations reported together:

OLS / SAR, OLS / QS OLS de-meaning, parametric and non-parametric LRV

GLS-ERS / SAR, GLS-ERS / QS pseudo-GLS de-meaning at c-bar = -7

GLS-BOUNDS / SAR, GLS-BOUNDS / QS GLS de-meaning at a bound-dependent c-bar = kappa-hat

The GLS-BOUNDS scheme estimates the pseudo-GLS noncentrality kappa-hat by interpolating
the Carrion-i-Silvestre & Gadea (2013) response surface over the standardised bounds
(c, c-bar). Each of the six statistics is compared with its own critical values, obtained
by simulating a regulated (reflected) Brownian motion folded into [c*sqrt(T), c-bar*sqrt(T)]
and recomputing the same statistic on each draw. All three tests reject the bounded unit-root
null for small values of the statistic.

Options

lbound(#) and ubound(#) give the (known) bounds; at least one must be finite.

iter(#) sets the number of Monte Carlo replications for the simulated critical
values (6 configurations are simulated). Larger values are more accurate but slower.

maxlag(#) caps the MAIC search for the spectral AR long-run variance.

seed(#) fixes the random-walk bank so results are reproducible; level(#)
selects which simulated quantile (1/2.5/5/10%) is shown as the critical value.

Stored results

boundeduroot mtests stores in r():

Scalars

r(N) number of observations

r(x0) first observation X0

r(kappa_ar) r(kappa_np) estimated GLS-BOUNDS kappa (SAR / QS)

r(lbound) r(ubound) r(iter) bounds and #draws

Matrices

r(stats) 6×3 statistics (rows = configs; cols MSB MZa MZt)

r(cv_msb) r(cv_mza) r(cv_mzt) 6×4 CVs (1/2.5/5/10%)

r(cpars) 6×2 standardised bounds (c, c-bar) per config

Examples

. tsset time

. boundeduroot mtests urate, lbound(0) ubound(100)

. boundeduroot mtests irate, lbound(0) iter(5000) seed(99)

References

Carrion-i-Silvestre, J. L., and M. D. Gadea. 2013. GLS-based unit root tests for bounded
processes.

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.

Author

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