*! garchur.sthlp v1.1.0 February 2026

Title

garchur -- GARCH-Based Unit Root Test with Trend and Structural Breaks

Syntax

garchur varname [if] [in] [,
options]

Model
breaks(#) number of structural breaks; default breaks(2)

model(string) ct (constant+trend, default) or c (constant only)

trim(#) trimming proportion for break search; default trim(0.15)

Output
noprint suppress printed output

graph display 3-panel diagnostic graph

savegraph(filename) save graph to file (.png, .pdf, .eps, ...)

Description

garchur implements the trend-GARCH(1,1) unit root test with endogenous
structural breaks proposed by Narayan and Liu (2015).
The model is:

Mean equation:

y_t = a_0 + a_1*t + rho*y_(t-1) + Sum(gamma_j * DU_jt) + e_t

Variance equation (GARCH(1,1)):

h_t = kappa + alpha*e^2_(t-1) + beta*h_(t-1)

where DU_jt = 1 for t >= TB_j (structural break dummy) and e_t is conditionally
normal with variance h_t. The null hypothesis is H_0: rho = 1 (unit root)
against H_1: rho < 1 (stationary).

Break-date estimation: Break dates are found sequentially by maximising the
absolute t-statistic of each break dummy (Narayan and Liu, 2015, eq. 3-4;
Narayan and Popp, 2010). Supports up to three endogenous breaks.

Estimation procedure: (1) OLS to obtain initial residuals; (2) GARCH(1,1)
maximum likelihood via direct grid search over (kappa, alpha, beta) using
standardised residuals for numerical stability; (3) weighted least squares (WLS)
re-estimation of the mean equation with weights 1/sqrt(h_t).

Critical values: Interpolated from Table III of Narayan and Liu (2015),
based on 50,000 Monte Carlo replications. Accounts for sample size T and GARCH
persistence (alpha+beta).

Auxiliary variables: After estimation, garchur creates
_garchur_ht (conditional variance h_t) and _garchur_sr
(standardised residuals e_t/sqrt(h_t)) in the dataset for
further analysis or custom graphing.

Options

Model

breaks(#) specifies the number of endogenous structural breaks.
Default is 2 (recommended). Maximum is 3.

model(string) specifies the deterministic component.
ct includes a constant and linear time trend (default).
c includes only a constant.

trim(#) sets the trimming proportion at each end of the sample when
searching for break dates. Default is 0.15 (15%). Allowable range: [0.05, 0.30].

Output

noprint suppresses the displayed output table.

graph produces a 3-panel diagnostic graph: (A) time series with OLS
trend overlay and vertical break-date lines; (B) estimated conditional variance
h_t; (C) standardised residuals e_t/sqrt(h_t) with +/-2 reference lines.

savegraph(filename) saves the combined graph to filename.
The format is determined by the file extension (.png, .pdf, .eps, .svg, etc.).

Examples

Setup:

. sysuse sp500, clear

. tsset date

Basic test (constant + trend, 2 structural breaks):

. garchur close

Display 3-panel diagnostic graph:

. garchur close, graph

Save graph to PNG:

. garchur close, graph savegraph("result.png")

Constant-only model, 3 structural breaks:

. garchur close, model(c) breaks(3)

Suppress output and retrieve stored results:

. garchur close, noprint

. display r(stat) // t-statistic

. display r(cv5) // 5% critical value

. display r(TB1) // first break date

Stored results

garchur stores the following in r():

Scalars
r(N) observations in mean equation

r(stat) t-statistic for H_0: rho = 1

r(rho) estimated AR coefficient rho

r(alpha) GARCH alpha (ARCH effect)

r(beta) GARCH beta (volatility persistence)

r(kappa) GARCH kappa (intercept)

r(ab) alpha+beta (sum; GARCH persistence)

r(halflife) half-life of shocks ln(0.5)/ln(alpha+beta)

r(loglik) log-likelihood at GARCH estimates

r(cv1) 1% critical value (Table III interpolation)

r(cv5) 5% critical value

r(cv10) 10% critical value

r(breaks) number of structural breaks

r(TB1) first break date (Stata time value)

r(TB2) second break date (if breaks >= 2)

r(TB3) third break date (if breaks = 3)

Macros
r(varname) variable tested

r(model) model specification (ct or c)

r(decision) test decision string

r(cmd) garchur

References

Narayan, P.K. and Liu, R. (2015).
A unit root model for trending time-series energy variables.
Energy Economics.
DOI: 10.1016/j.eneco.2014.11.021

Narayan, P.K. and Popp, S. (2010).
A new unit root test with two structural breaks in level and slope at unknown time.
Journal of Applied Statistics, 37, 1425–1438.

Narayan, P.K. and Liu, R. (2011).
Are shocks to commodity prices persistent?
Applied Energy, 88, 409–416.

Cook, S. (2008).
Maximum likelihood unit root testing in the presence of GARCH.
Communications in Statistics — Simulation and Computing, 37, 756–765.

Author

Support: merwanroudane920@gmail.com

Please cite as:

Roudane, M. (2026). garchur: Stata module implementing the Trend-GARCH unit root test with structural breaks (v1.1.0). Statistical Software Components, Boston College Department of Economics.

Also see

garchur_graph for the graph module documentation.