*! version 1.0.0 08jul2026 Ozan Eruygur

Title

mindf -- HLT unit root tests with up to three breaks in trend
(Harvey, Leybourne and Taylor, 2013)

Syntax

mindf varname [if] [in], breaks(#) [kmax(#)
lags(#)]

varname may contain time-series operators. The data must be tsset and
the sample must be contiguous (no gaps).

Description

mindf computes the minimum Dickey-Fuller unit root tests of Harvey,
Leybourne and Taylor (2013, Journal of Econometrics 177, 265-284), henceforth
HLT. The null hypothesis is that the series contains an autoregressive unit
root; the alternative is stationarity around a linear trend with up to m
breaks in slope, where m is set by breaks(). Breaks in trend are
permitted under both the null and the alternative hypothesis.

The data generating process is that of HLT, equations (2.1)-(2.2):

y_t = mu + beta*t + gamma_1*DT_t(tau_1) + ... + gamma_m*DT_t(tau_m) + u_t

u_t = rho*u_(t-1) + e_t

where DT_t(tau) = t - floor(tau*T) if t > floor(tau*T) and 0 otherwise, so
that each gamma_i measures the change in the slope of the linear trend at
the unknown break date floor(tau_i*T). The null hypothesis is a unit root,
H0: rho = 1; under the alternative, rho < 1, the series is stationary
around the broken trend. Because the breaks sit in the deterministic
component while the hypotheses concern only rho, the breaks are present
under both hypotheses. The disturbance e_t may be serially correlated,
which the lag augmentation of the ADF regression accounts for.

The test statistic MDFm is the infimum, taken across all candidate break dates
in a trimmed range subject to a minimum separation between breaks, of local
GLS detrended augmented Dickey-Fuller statistics. The deterministic component
contains a constant, a linear trend, and m broken trend regressors DT_t(Tb) =
max(t - Tb, 0). Candidate break dates run from floor(0.15*T) to
floor(0.85*T), with a minimum separation of floor(0.15*T) between breaks;
these fractions are fixed at the values used by HLT and hard-coded in the
original GAUSS program. GLS detrending uses the quasi-differencing parameter cbar
tabulated by HLT (Table 1): 17.6 for one break, 21.5 for two breaks, and 25.5
for three breaks. The ADF lag order is selected by the MAIC of Ng and Perron
(2001) computed on OLS-detrended residuals, following the modification of
Perron and Qu (2007), exactly as in the original HLT GAUSS code.

Two design features place mindf in a distinct family of unit root
tests with breaks. First, trend breaks are permitted under both the unit
root null and the trend-stationary alternative, so the test remains valid
when breaks occur in a unit root process. Second, detrending is by local
GLS rather than OLS, and the statistic is the infimum over the full grid of
candidate break dates; HLT show that as a result the power of the test is
approximately invariant to the presence and magnitude of the trend breaks,
without requiring a break pretest. Infimum tests based on OLS detrending in
which breaks enter only under the alternative hypothesis, such as Zivot and
Andrews (1992) and its multiple-break extension by Kapetanios (2005) with
sequentially dated breaks, form a different family.

Contribution of this package. The Mata engine is a line-by-line port
of the original GAUSS program mindf.gp distributed by the Granger
Centre for Time Series Econometrics, University of Nottingham. The
distributed program covers one and two breaks only.
Our Stata package mindf extends the test to three breaks, a case
defined and tabulated in
HLT but with no published code. The three-break extension was verified
against the original GAUSS procedures to at least 12 decimal places, and
its critical values were reproduced by simulation within Monte Carlo error.

Options

breaks(#) is required and sets the maximum number of trend breaks m; it
must be 1, 2 or 3. HLT regard allowing for up to three breaks as sufficient
for the great majority of economic applications. Setting m above the true
number of breaks costs power through overfitting; setting it below leaves a
neglected break and the test loses power against the stationary alternative.

kmax(#) sets the maximum lag order for the MAIC search; default floor(12*(T/100)^(1/4)).

lags(#) fixes the ADF lag order at # and skips the MAIC search. This
permits replication of the k = 0 settings used in the size and power
simulations of HLT.

Critical values

Asymptotic critical values from HLT, Table 1 (trimming 0.15, separation 0.15):

| cbar 10% 5% 1%
-----+---------------------------------
MDF1 | 17.6 -3.57 -3.85 -4.40
MDF2 | 21.5 -4.30 -4.58 -5.10
MDF3 | 25.5 -4.81 -5.06 -5.58

The test rejects for large negative values of the statistic.

The embedded critical values were verified by an independent simulation of
the null distribution of the statistic; the simulated quantiles reproduce
HLT, Table 1 within Monte Carlo error.

Examples: replication of HLT (2013), Table 4

The dataset contains the logarithms of four Grilli and Yang (1988) primary
commodity price indices relative to the price of manufactures (MUV), annual,
1900-2003, T = 104, as updated by Pfaffenzeller, Newbold and Rayner (2007) and
extended by Geronimi, Anani and Taranco (Mendeley Data,
doi:10.17632/j24mjpcrrz.1, sheet Indexgy), from which the series were
constructed as y = ln(index/MUV).

. use https://eruygurakademi.com/datasets/mindf/mindf_gy.dta, clear

. tsset year

. mindf lcopper, breaks(1)

. mindf lcopper, breaks(2)

. mindf lhides, breaks(2)

. mindf llead, breaks(1)

. mindf lsilver, breaks(2)

. display %20.14f r(mdf)

Published values (HLT, Table 4; k selected by MAIC): Copper MDF1 = -3.15, MDF2
= -4.81; Hides MDF1 = -3.45, MDF2 = -6.34; Lead MDF1 = -4.62, MDF2 = -4.86;
Silver MDF1 = -2.04, MDF2 = -4.71. With breaks(2) the unit root null is
rejected at the 5 percent level for all four series.

Allowing up to three breaks; for lcopper this yields MDF3 = -4.940 with the
minimizing breaks in 1914, 1934 and 1969:

. mindf lcopper, breaks(3)

Smaller maximum lag order for the MAIC search:

. mindf lcopper, breaks(2) kmax(8)

Fixed lag order, skipping the MAIC search (here k = 0, as in the size and
power simulations of HLT):

. mindf lcopper, breaks(2) lags(0)

Replication with the original GAUSS code

The original GAUSS program is available from the Granger Centre, University
of Nottingham, at
https://www.nottingham.ac.uk/research/groups/grangercentre/documents/code/mindf.zip
and is mirrored at
https://eruygurakademi.com/datasets/mindf/mindf.zip.

To reproduce the same numbers in GAUSS, create a folder named
gaussexample on the C: drive (so its path is C:\gaussexample),
download mindf_web_gauss.zip from the link below and extract the files
it contains (mindf_gauss_check.gss, mindf_procs.src,
mindf_gy.csv) into that folder, then open
mindf_gauss_check.gss in GAUSS and run it (Run / F5).
mindf_procs.src contains the computational procedures of the original
mindf.gp, byte-identical:

https://eruygurakademi.com/datasets/mindf/mindf_web_gauss.zip

The program computes MDF1, MDF2 and MDF3 for lcopper and prints the
statistics to 14 decimal places together with the minimizing break years.
The MDF1 and MDF2 computations follow the loops of the original
mindf.gp. Since the original program contains no three-break code,
the MDF3 block in mindf_gauss_check.gss is the three-break extension
of this package: it calls the same byte-identical original procedures and
only adds a search loop over a third break date. The corresponding Stata
commands are:

. use https://eruygurakademi.com/datasets/mindf/mindf_gy.dta, clear

. tsset year

. mindf lcopper, breaks(1)

. mindf lcopper, breaks(2)

. mindf lcopper, breaks(3)

Both produce the same results:

MDF1 = -3.15418344335429 (break: 1926)

MDF2 = -4.81289788428944 (breaks: 1943, 1968)

MDF3 = -4.94034329773017 (breaks: 1914, 1934, 1969)

mindf reproduces the GAUSS statistics for all Table 4 series to at
least 12 decimal places; the full-precision values are stored in
r(mdf) and can be displayed with display %20.14f r(mdf).

Stored results

mindf stores the following in r():

Scalars

r(mdf) MDFm test statistic

r(breaks) number of trend breaks m

r(cbar) GLS quasi-differencing parameter

r(cv1) 1% critical value

r(cv5) 5% critical value

r(cv10) 10% critical value

r(N) number of observations

r(trim) trimming fraction

r(sep) minimum separation fraction

r(kmax) maximum lag order for MAIC

r(k) lag order at the minimizing break dates

r(obs#) observation index of break # minimizing the DF statistic

r(tb#) time value of break # minimizing the DF statistic

Macros

r(varname) name of the tested series

r(cmd) mindf

References

Geronimi, V., Anani, E., Taranco, A. 2018. Data for: Revisiting the
Prebisch-Singer hypothesis (1900-2016). Mendeley Data,
doi:10.17632/j24mjpcrrz.1.

Grilli, E.R., Yang, M.C. 1988. Commodity prices, manufactured goods prices,
and the terms of trade of developing countries. World Bank Economic Review 2,
1-48.

Harvey, D.I., Leybourne, S.J., Taylor, A.M.R. 2013. Testing for unit roots in
the possible presence of multiple trend breaks using minimum Dickey-Fuller
statistics. Journal of Econometrics 177, 265-284.

Kapetanios, G. 2005. Unit-root testing against the alternative hypothesis of
up to m structural breaks. Journal of Time Series Analysis 26, 123-133.

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

Perron, P., Qu, Z. 2007. A simple modification to improve the finite sample
properties of Ng and Perron's unit root tests. Economics Letters 94, 12-19.

Pfaffenzeller, S., Newbold, P., Rayner, A. 2007. A short note on updating the
Grilli and Yang commodity price index. World Bank Economic Review 21, 151-163.

Zivot, E., Andrews, D.W.K. 1992. Further evidence on the great crash, the
oil-price shock, and the unit-root hypothesis. Journal of Business and
Economic Statistics 10, 251-270.

Author

H. Ozan Eruygur

AHBV University, Ankara, Turkiye.

Department of Economics

https://www.ozaneruygur.com

eruygur@gmail.com

Eruygur Academy and Consulting (Eruygur Akademi ve Danismanlik), Ankara,
Turkiye.

https://www.eruygurakademi.com

eruygurakademi@gmail.com

mindf v1.0.0 - July 2026

The test implemented here was proposed by David I. Harvey, Stephen J.
Leybourne (University of Nottingham) and A.M. Robert Taylor (University of
Essex) in Harvey, Leybourne and Taylor (2013). mindf is a Stata/Mata
port of the original GAUSS code mindf.gp distributed by the Granger
Centre for Time Series Econometrics, University of Nottingham; the
three-break case is an extension by this package.

Please cite as:

Eruygur, H. O. 2026. mindf: Harvey, Leybourne and Taylor (2013) unit
root tests allowing for up to three breaks in trend. Stata package version
1.0.0. Available from: https://www.eruygurakademi.com.

Also see

kapetanios, leestra, narayanp, ckptest,
kpssbr (if installed)