*! version 1.5.1 22jul2026

Title

byperron -- Determining structural breaks in time series models
(Bai-Perron 2003; Yamamoto-Perron 2013)

Syntax

byperron depvar indepvars [if] [in] [, options]

method(string) estimation method: full, trun, or band;
default is trun

wl(#) lower band limit as a multiple of pi; required with
method(band)

wh(#) upper band limit as a multiple of pi; required with
method(band)

maxbreaks(#) maximum number of breaks m; default is
maxbreaks(5)

trim(#) trimming epsilon; one of 0.05, 0.10, 0.15, 0.20, 0.25; default is
trim(0.15)

robust(#) 0 or 1; allow serial correlation and heteroskedasticity in the
errors; default is robust(1)

hetdat(#) 0 or 1; allow different moment matrices of the regressors across
segments; default is hetdat(1)

hetvar(#) 0 or 1; allow different error variances across segments; default
is hetvar(0)

prewhit(#) 0 or 1; apply VAR(1) prewhitening to the HAC estimator; only
with method(full); default is prewhit(0)

nodemean do not center the data; use depvar and indepvars exactly as
supplied. By default byperron demeans them over the estimation sample

detrend(string) detrend the dependent variable before estimation:
none (the default) or linear. Applies to depvar only, as in the empirical
application of Yamamoto and Perron (2013)

noalign do not align the sample to the differenced regressor frame; use
every feasible observation

indepvars are the regressors whose coefficients are allowed to change across regimes
(pure structural change model). Time-series operators are allowed. At most 10 regressors
are allowed (critical value tables).

Description

byperron estimates and tests multiple structural changes in linear time series
models, implementing both the classical time domain procedure of Bai and Perron (1998,
2003) and the band spectral regression approach of Yamamoto and Perron (2013). All
procedures require I(0) variables. The asymptotic theory of Bai and Perron (1998, 2003)
explicitly precludes integrated variables (variables with an autoregressive unit root)
while permitting trending regressors, and the band spectral framework of Yamamoto and
Perron (2013) maintains short memory stationarity of the data (their Assumption 2.1). Do
not apply the command to unit root series: difference them first, which the D.
operator does internally. For cointegrating relationships among I(1) variables with
structural breaks, see the author's kperrony command.

The break dates are obtained by global minimization of the sum of squared residuals
computed from the retained frequency components, using the dynamic programming algorithm
of Bai and Perron (1998, 2003) applied to segment-specific real finite Fourier transforms
(Harvey 1978).

The command reports: (a) the supF tests of 0 versus k breaks for k = 1, ..., m; (b) the
double maximum tests UDmax and WDmax against an unknown number of breaks; (c) the
sequential supF(l+1|l) tests for l = 1, ..., m-1 computed from the global optimizers under
the null, as in the original Bai-Perron program, together with the implied new break date;
(d) the break dates from the global minimization for each number of breaks with the
associated band spectral sum of squared residuals. Asymptotic critical values at the 10,
5, 2.5, and 1 percent levels are those of Bai and Perron (1998, 2003).

This command is an exact port of the official MATLAB code bsr_codes (Yohei Yamamoto,
February 19, 2013) accompanying the article, including all of its numerical conventions.
The full spectrum method reproduces the Bai and Perron time domain procedure.

Options

Method and frequency band

method(string) selects the frequency set on which the tests and the break dates are
computed. The names abbreviate the spectrum used: full stands for the
full spectrum (all frequencies are used; this is the classical Bai-Perron time domain
procedure), trun for the truncated spectrum (the lowest ceil(log(n))
frequencies of each segment of length n are removed), and band for the
band spectrum (only the frequencies in the band given by wl() and wh()
are used). The truncated and band spectra are the two methods proposed by the band
spectral regression approach of Yamamoto and Perron (2013); the full spectrum is the
classical benchmark that they extend. The default is method(trun), the protected
general test. See
Methods below for guidance on the choice.

wl(#) and wh(#) set the lower and upper limits of the frequency band as
multiples of pi, with 0 <= wl < wh <= 1; they are required by, and only allowed
with, method(band). The zero frequency is included only with wl(0). A
frequency w*pi corresponds to cycles of period 2/w periods of the data, so a
window of cycle lengths from p1 to p2 periods is obtained with
wl(2/p2) and wh(2/p1). For quarterly data, cycles
between 4 and 32 quarters (the business cycle band) correspond to
wl(0.0625) wh(0.5).

Breaks and trimming

maxbreaks(#) sets the maximum number of breaks m. Global break dates are estimated
for 1 to m breaks, the supF tests are computed for k = 1, ..., m, and the sequential tests
up to supF(m|m-1), so the sequential procedure can select at most m breaks. The admissible
maximum depends on trim() through the tabulated critical values (for example 5 with
trim(0.15), 8 with trim(0.10), 9 with trim(0.05)); the default is
maxbreaks(5).

trim(#) sets the minimal admissible regime length as a fraction of the sample: each
regime must contain at least h = ceil(trim*T) observations. Admissible values are
0.05, 0.10, 0.15, 0.20 and 0.25; the
default is trim(0.15), the value used in Yamamoto and Perron (2013). A smaller
trimming admits
shorter regimes and more breaks at the cost of less precise dating. These are exactly the
trimmings for which Bai and Perron (2003) tabulate critical values, with
maximum numbers of breaks 9, 8, 5, 3 and 2 respectively; Bai and Perron (2003) recommend
the larger trimmings when heterogeneity or serial correlation is allowed in the
construction of the tests.

Covariance

robust(#) selects the covariance estimator used in the test statistics, as in the
original code. With robust(1), the default, the covariance is robust to
heteroskedasticity and, for method(full), to serial correlation (HAC with the
quadratic spectral kernel and the automatic bandwidth of Andrews (1991) based on an AR(1)
approximation); for method(trun) and method(band) the White (1980) estimator
is applied to the filtered data. With robust(0) a homoskedastic covariance is
used. Following the documentation of the Bai-Perron program, robust(1) should not be
combined with lagged dependent variables among the regressors; use robust(0) in that
case.

hetdat(#) controls the moment matrices of the regressors in the construction of the
covariance entering the tests (the hetdat option of the Bai-Perron program). With
hetdat(1), the default and the setting of the original script, the moment matrix is
estimated separately on each segment; with hetdat(0) a single moment matrix
estimated from the full sample is imposed on every segment. Keep the default unless there
are firm grounds to assume that the distribution of the regressors is identical across
regimes: estimating the matrices freely costs little, while imposing equality wrongly
distorts the tests.

hetvar(#) controls the variance of the residuals in the construction of the
covariance entering the tests (the hetvar option of the Bai-Perron program). With
hetvar(0), the default and the setting of the original script, a common variance
estimated from the full sample is used; with hetvar(1) the variance is estimated
separately on each segment. Set hetvar(1) when the variance of the errors may itself
change across regimes, for example when a volatility moderation accompanies the
coefficient changes. Following the documentation of the Bai-Perron program, the option is
relevant under robust(0); with robust(1) the robust long run estimator is used
instead.

prewhit(#) applies VAR(1) prewhitening in the HAC covariance estimator and is only
allowed with method(full) under robust(1). The default is prewhit(0),
the setting of the original script. Prewhitening fits a VAR(1) to the residuals before the
kernel estimation; use it when the errors are strongly serially correlated.

Data handling

nodemean skips the internal demeaning and uses the variables exactly as supplied. Do
not use this option unless you know exactly what you are doing. In particular, if you have
not demeaned the data yourself beforehand, this option must not be used: the regression
would then include neither a constant term nor centered variables, so the intercept would
be omitted from a model that requires one, and every reported statistic would refer to
that misspecified regression. Its only legitimate uses are the bit for bit replication
of an external pipeline whose data are already centered, and exercises that deliberately
require no centering. Demeaning an already centered series changes nothing beyond the last
floating point digits, so with prepared data it is always safe to leave the default on.
See Methods for why a constant term must not be included.

detrend(string) linearly detrends the dependent variable before estimation
(linear), as in the level specification of the empirical application of Yamamoto and
Perron (2013); the default
none leaves it untouched. Detrending applies to the dependent variable only; see
Methods for the detrend window.

noalign disables the automatic alignment of the sample to the differenced regressor
frame (see Methods) and uses every feasible observation instead. It has an effect
only when a regressor carries D. or S. operators. Use it when the largest
feasible sample is preferred over exact correspondence with the sample convention of the
original code; the two differ only by the first observation of the sample.

Methods

The three methods

The method names abbreviate the frequency set used: full stands for the full
spectrum, trun for the truncated spectrum, and band for the band spectrum.
The terminology is that of Yamamoto and Perron (2013): the columns of their Table 9 are
labeled Full, Truncated and Cycle, and the method switch of the original script
main.m reads 1: full, 2: truncation, 3: business-cycle. The Cycle case is the band
method applied to the business cycle frequencies, so method(band) is its general
form.

method(full) uses all frequencies; this is the standard time domain estimation of
Bai and Perron (1998). With robust(1) the covariance matrix uses a HAC estimator
with the quadratic spectral kernel and the automatic bandwidth of Andrews (1991) based on
an AR(1) approximation, optionally with VAR(1) prewhitening (prewhit(1)).

method(trun) removes the lowest L = ceil(log(n)) real Fourier components of each
segment, where n is the segment length, as suggested in Section 3 of Yamamoto and Perron
(2013). This makes
the tests robust to low frequency contaminations such as level shifts or trends in the
errors. With robust(1) the covariance matrix uses the White (1980)
heteroskedasticity robust estimator applied to the filtered data.

method(band) uses only the frequencies in the band [wl*pi, wh*pi] specified through
wl() and wh(). For example, business cycle frequencies for quarterly data
(periods between 4 and 32 quarters) correspond to wl(0.0625) wh(0.5). The zero
frequency is included only when wl(0) is specified. The White (1980) covariance
estimator is used with robust(1), as in method(trun).

Same statistics, same critical values

The three methods compute the same battery of statistics on different frequency sets. When
no frequency is discarded the transformation is orthonormal and preserves the sum of
squared residuals, so the full spectrum regression is algebraically identical to the time
domain regression: method(full) therefore delivers exactly the classical Bai-Perron
tests and break dates. Discarding frequencies breaks this identity and produces genuinely
spectral tests. A central result of Yamamoto and Perron (2013) is that the truncated and
band versions of the tests have the same limit distributions as their Bai-Perron
counterparts, which is why the same critical value tables apply to all three methods.

Which method for which question

The economic motivation is that many relationships are horizon specific, so that a single
coefficient estimated on the raw series mixes distinct mechanisms. Under the permanent
income hypothesis, consumption follows the persistent movements of income almost one for
one but responds weakly to transitory quarterly fluctuations, so the propensity to consume
out of income differs across horizons. Similarly, money growth and inflation move
essentially one for one at long horizons while the quarterly relation is weak. A full
spectrum regression delivers a mixture of these horizon specific coefficients, and a
structural change test based on it asks a correspondingly mixed question; the spectral
framework makes it possible to ask the question horizon by horizon.

Choosing between the methods: use method(full) for the classical general stability
test; use method(trun) for a general test protected against low frequency
contamination (the number of discarded frequencies follows a rule of the segment length,
it is not a user choice): typical contaminants are slow components unrelated to the
relationship of interest, such as demographic trends and labor force participation
movements in per capita hours, trend breaks in productivity, or the secular decline of
trend inflation in Phillips curve estimation, all of which masquerade as coefficient
breaks in full spectrum tests; use method(band) for hypotheses attached to a
particular horizon: the Phillips curve and Okun's law are business cycle relationships, so
the question of whether the Phillips curve has flattened is properly a question about its
slope at business cycle frequencies, to be separated from the footprint of declining trend
inflation at the low frequencies. A frequency w*pi corresponds to a cycle period of
2/w time units, so cycles with periods between p1 and p2 periods of the
data map to wl(2/p2) and wh(2/p1). For quarterly data,
periods between 4 and 32 quarters (1 to 8 years, the business cycle band of Yamamoto and
Perron (2013))
give wl(0.0625) wh(0.5).

What the simulations show

The simulations in Yamamoto and Perron (2013) support this division of labor and clarify
the trade-offs. When the break is common to all frequencies and there is no contamination,
the full spectrum test has the highest power, so nothing is lost by using the classical
procedure in the textbook case.

When the errors carry low frequency contamination (level shifts, remaining trends, long
memory), the untruncated tests suffer serious size distortions and tend to find breaks
that are not there. Truncation restores the size and improves the size-adjusted power
considerably; the results are insensitive to the particular truncation rule, and removing
even a single frequency already yields a dramatic improvement over the untruncated
test.

When the break is confined to a frequency band, three cases must be distinguished.
Testing in the correct band gives the highest power, because only the frequencies that
carry the break enter the regression; the gains over the full spectrum are larger when the
break lies in higher frequencies. The full spectrum test keeps positive but diluted power:
the informative frequencies are in the pool, but mixed with the noise of the frequencies
whose coefficients never change. Testing in a band that does not contain the break leaves
the test with no power at all: every frequency component entering the regression then has
constant coefficients, so the null hypothesis is effectively true within that band, and
the rejection probability stays at the nominal significance level whatever the size of the
break elsewhere (power equals size). A band should therefore reflect a genuine hypothesis
about where the instability lives.

The flip side is a diagnostic virtue. A break date answers the question of when the
relationship changed; running the test over different frequency sets answers the question
of at which cycle lengths it changed, because only the frequency sets that carry the break
lead to rejections. The empirical application of Yamamoto and Perron (2013) is exactly
such an exercise: the full spectrum tests find breaks in the hours-productivity relation,
but once the lowest frequencies are removed by the truncation, and within the business
cycle band, none of the tests is significant. The pattern of rejections therefore places
the instability in the lowest frequencies, and shows that the relation is stable over any
band excluding them, in particular over the business cycle band.

In short, the truncated and band methods are complements rather than substitutes, of each
other and of the full spectrum test. The truncated test establishes whether an instability
survives once the most contamination prone frequencies are removed; the band test
establishes whether the relationship is stable at the horizon where the economic
hypothesis lives; and the comparison of the results across the three methods attributes a
detected break to the horizon responsible for it, as in the hours and productivity
application above. The methods generalize the Bai-Perron procedure rather than replace it,
and reduce to it exactly under method(full).

Computational conventions

Following the original code, the supF statistics for method(trun) and
method(band) use the number of retained Fourier components in the degrees of freedom
correction. The regressors should not include a constant term: under truncation or a band
excluding frequency zero the constant column is annihilated by the filter and the moment
matrix becomes singular. For this reason byperron demeans the dependent variable
and every regressor over the estimation sample by default, exactly as in the empirical
application of Yamamoto and Perron (2013) (footnote 6). You therefore pass the variables
directly, without
generating centered copies and without a constant term.

Demeaning

Do not use nodemean unless you know exactly what you are doing. If the data have not
been demeaned beforehand, the option must not be used: the regression would then include
neither a constant term nor centered variables, so the intercept would be omitted from a
model that requires one, and all reported statistics would refer to that misspecified
regression. Demeaning an
already centered series changes nothing beyond the last floating point digits, so with
prepared data the default can always be left on.

Detrending

With detrend(linear) the dependent variable is linearly detrended before estimation,
exactly as in the level specification of the empirical application of Yamamoto and Perron
(2013). The trend is
fitted by a no-constant regression on 1, 2, ..., n and the residuals are used; the
subsequent demeaning absorbs the level. The linear trend is fitted on the estimation
sample extended back by the maximum lag order among the regressors: the original code
detrends the dependent variable before the regressor lags drop the low order observations
at the front of the sample, and the extended window reproduces that span. Observations
before the estimation sample enter the detrend window whenever the dependent variable is
observed there, regardless of if and in. Detrending applies to the dependent
variable only, and only the linear form used in Yamamoto and Perron (2013) is provided.
With
detrend(none), the default, no detrending is performed and the behavior of the
command is completely unchanged.

Sample alignment

When a regressor involves differencing, byperron aligns the sample exactly as the
original code does: the differenced regressor defines a frame that begins where the
difference first becomes computable (the observation for which no growth rate exists is
discarded), and all further transformations are computed within that frame. In particular
the dependent variable enters from the second observation of the frame onward, whether it
is differenced (its own difference consumes that observation) or in levels (Yamamoto and
Perron (2013) use the same sample for both specifications), and the regressor lags are
then taken within the
frame. The data themselves are untouched. This alignment is automatic whenever a regressor
carries D. or S. operators and does nothing otherwise; specify noalign
to use every feasible observation instead.

Together with time-series operators in the varlist, this means no manual data preparation
at all: pass the raw series and let the command difference (D.), lag (L.),
detrend, demean and align internally.

Numerical properties

Two numerical properties of the truncated and band methods are worth knowing. First, the
minimized sum of squared residuals is not comparable across different numbers of breaks:
each segment is filtered with a selection that depends on its own length, so the SSR
reported for m+1 breaks can exceed the one reported for m breaks. This is a property of
the objective function, it carries no implication for the tests, and the number of breaks
is selected from the tests, never by comparing SSRs. Second, the sequential supF(l+1|l)
statistics can coincide across several l: when the conditioning break sets share the same
final segment, the best additional break is the same one in that segment each time.

Selection of the number of breaks

The output ends with the reporting rule used for the Dates row of Table 9 in Yamamoto and
Perron (2013): if
the supF test of 0 versus 1 break is significant at the 5 percent level, the number of
breaks is increased while the sequential supF(l+1|l) tests remain significant at that
level, and the break dates of the global minimization at the selected number are reported;
otherwise no break is selected. When the data are tsset, break dates are displayed
as values of the time variable (calendar dates if the time variable carries a date
format); the matrix e(datevec) stores the corresponding observation indices within
the estimation sample. Without a time variable the indices themselves are displayed. The
estimation sample should be a single uninterrupted stretch of time series observations.

Examples

Replication of Table 9(b) of Yamamoto and Perron (2013)

Replication of the empirical example of Yamamoto and Perron (2013), Table 9(b),
using the original hours-productivity data, served from the author's site and also shipped
with the package. File data_hour.csv: column 1 (v1) is log productivity,
column 2 (v2) is log hours, quarterly, 1948Q1 to 2009Q4 (248 observations,
unmodified). No manual preparation is needed: the raw series are passed with time-series
operators, and differencing, lagging, detrending, demeaning and the sample alignment are
all done by the command. The regressors are the first four lags of productivity growth,
L(1/4).D.v1; the sample alignment of the original code is applied automatically.
These commands reproduce the Table 9(b) results exactly (T = 242, sample 1949Q3 to
2009Q4).

. import delimited "https://eruygurakademi.com/datasets/byperron/data_hour.csv", asdouble clear

. gen t = tq(1948q1) + _n - 1

. format t %tq

. tsset t

Hours in levels (linearly detrended by the command, as in Yamamoto and Perron
(2013)), truncated
method

. byperron v2 L(1/4).D.v1, detrend(linear)

Hours in first differences (differenced by the D. operator), full
spectrum

. byperron D.v2 L(1/4).D.v1, method(full)

Business cycle band (cycles of 4 to 32 quarters: wl = 2/32 = 0.0625, wh = 2/4 =
0.5)

. byperron D.v2 L(1/4).D.v1, method(band) wl(0.0625) wh(0.5)

General use and options illustrated

Structural change tests with a standard Stata example dataset (West German quarterly data,
Lutkepohl 1993). The data are already tsset, so the reported break dates are labeled
with calendar quarters. The variables are passed directly; byperron demeans them
internally. Each call below states its purpose.

. webuse lutkepohl2, clear

The default call: the truncated spectrum, a general stability test protected against low
frequency contamination.

. byperron consump inc inv

The classical procedure of Bai and Perron (2003), using all frequencies; the most powerful
choice when no contamination is suspected and the break may affect all horizons.

. byperron consump inc inv, method(full)

Stability over business cycle frequencies only (cycles of 4 to 32 quarters: wl = 2/32 =
0.0625, wh = 2/4 = 0.5); use when the hypothesis concerns a specific horizon.

. byperron consump inc inv, method(band) wl(0.0625) wh(0.5)

Finer trimming: regimes as short as 10 percent of the sample are admitted; use when short
regimes are plausible, at the cost of noisier dating.

. byperron consump inc inv, trim(0.10)

Coarser trimming: each regime must cover at least 20 percent of the sample, and the
critical value tables then allow at most 3 breaks.

. byperron consump inc inv, method(trun) maxbreaks(3) trim(0.20)

Homoskedastic covariance; only when the errors are believed homoskedastic and, for the
full spectrum, serially uncorrelated. Also the appropriate choice when lagged dependent
variables are included among the regressors.

. byperron consump inc inv, method(full) robust(0)

Imposing identical regressor moment matrices across regimes; the default hetdat(1)
is recommended, so this is for the rare case in which equality is known to hold.

. byperron consump inc inv, hetdat(0)

Allowing the error variance to change across regimes; use when variance shifts may
accompany the coefficient changes (relevant under robust(0)).

. byperron consump inc inv, robust(0) hetvar(1)

VAR(1) prewhitening of the HAC estimator; use when the errors are strongly serially
correlated.

. byperron consump inc inv, method(full) prewhit(1)

Removing a linear trend from the dependent variable before estimation, as in the level
specification of Yamamoto and Perron (2013).

. byperron consump inc inv, detrend(linear)

Equivalence with the original MATLAB code

The original script

The original code is driven by the script main.m of bsr_codes. The user sets
two switches at the top of the script, data_transform (0 for hours in levels, 1 for
first differences) and method (1 full spectrum, 2 truncation, 3 business cycle band
with wl=pi*(1/16) and wh=pi*(1/2)), and the script then differences log
productivity, aligns the series, linearly detrends hours in the level case, constructs the
four lags, demeans, and prints the tests.

Running the original code yourself

The results can be reproduced in MATLAB or in GNU Octave, step by step:

1. Click https://eruygurakademi.com/datasets/byperron/byperron_matlab.zip
and save the file.

2. Extract the zip file into a new folder (right click, Extract All on Windows).

3. Start MATLAB or Octave and make that folder the current folder: in MATLAB paste the
folder path into the address bar at the top of the window; in Octave use the file browser
panel on the left, or type cd followed by the folder path.

4. Open the file run_byperron.m (double click it in the file panel).

5. Two lines near the top of the file choose the specification: data_transform
(0 = hours in levels, 1 = hours in first differences) and method (1 = full spectrum,
2 = truncation, 3 = business cycle band). For the headline example set
data_transform=1; and method=1; and save the file.

6. Run the script: in MATLAB press the green Run button; in Octave type
run_byperron at the prompt and press Enter.

7. The results appear in the command window: the supF tests, UDmax and WDmax, the
sequential tests and the break dates.

8. Run the matching byperron command from the correspondence list below in Stata:
the numbers coincide digit for digit.

Correspondence and verified agreement

The Stata replication starts from the same data file served online:

. import delimited "https://eruygurakademi.com/datasets/byperron/data_hour.csv", asdouble clear

. gen t = tq(1948q1) + _n - 1

. format t %tq

. tsset t

Each configuration of the script then corresponds to one byperron command:

MATLAB: data_transform=1; method=1;

. byperron D.v2 L(1/4).D.v1, method(full)

MATLAB: data_transform=1; method=2;

. byperron D.v2 L(1/4).D.v1, method(trun)

MATLAB: data_transform=1; method=3;

. byperron D.v2 L(1/4).D.v1, method(band) wl(0.0625) wh(0.5)

MATLAB: data_transform=0; with method 1, 2 or 3

. byperron v2 L(1/4).D.v1, detrend(linear) method(full) (or trun,
band)

For the first pair, data_transform=1; method=1; in MATLAB against
byperron D.v2 L(1/4).D.v1, method(full) in Stata, the printed results are (three
decimals shown; the agreement holds to at least 13 significant digits):

statistic main.m byperron

SupF(1) 18.922 18.922
SupF(2) 16.148 16.148
SupF(3) 12.259 12.259
SupF(4) 9.929 9.929
SupF(5) 7.423 7.423
UDmax 18.922 18.922
WDmax 18.986 18.986
SupF(2|1) 10.590 10.590
SupF(3|2) 8.780 8.780
SupF(4|3) 4.866 4.866
Break date 1976:Q1 1976q1

The outputs are identical. For example, with data_transform=1; method=1; the script
reports SupF(1) = 18.9218, SupF(2|1) = 10.5899, UDmax = 18.9218 and the break date
1976:Q1; the command byperron D.v2 L(1/4).D.v1, method(full) reports exactly the
same numbers. The agreement has been verified for both specifications and all three
methods, statistic by statistic (the supF tests for k = 1, ..., 5, UDmax and WDmax, every
sequential test, and every global break date and sum of squared residuals for one to five
breaks), to at least 13 significant digits, with all break dates identical. The defaults
of byperron
(trim(0.15) maxbreaks(5) robust(1) hetdat(1) hetvar(0) prewhit(0)) are the parameter
values set at the top of main.m.

Stored results

byperron stores the following in e():

Scalars

e(N) number of observations T

e(h) minimal segment length, ceil(trim*T)

e(q) number of regressors

e(m) maximum number of breaks

e(trim) trimming epsilon

e(robust), e(hetdat), e(hetvar), e(prewhit) covariance
options

e(demean) 1 if the data were demeaned internally, 0 with
nodemean

e(detrend) 1 if the dependent variable was linearly detrended, 0
otherwise

e(align) 1 if the differenced regressor frame alignment excluded
observations, 0 otherwise

e(mseq) number of breaks selected by the sequential procedure at the 5
percent level (0 if the supF test of 0 versus 1 break is not significant)

e(wl), e(wh) band limits in multiples of pi (method band only)

e(udmax) UDmax statistic

e(wdmax) WDmax statistic (5 percent level weights)

Macros

e(cmd) byperron

e(cmdline) command as typed

e(method) full, trun, or band

e(detrendtype) none or linear

e(depvar) dependent variable

e(indepvars) regressors

Matrices

e(supf) m x 1, supF tests of 0 vs k breaks

e(wsupf) m x 1, weighted supF tests (5 percent level weights)

e(glb) m x 1, global minimal SSR for each number of breaks

e(datevec) m x m, break dates; column k holds the k-break global
optimizers

e(supfseq) (m-1) x 2, supF(l+1|l) statistics and new break dates

e(cv_supf) 4 x m, critical values of supF at 10, 5, 2.5, 1 percent

e(cv_seq) 4 x m, critical values of supF(l+1|l)

e(cv_dmax) 4 x 2, critical values of UDmax and WDmax

Functions

e(sample) marks estimation sample

References

Andrews, D. W. K. (1991). Heteroskedasticity and autocorrelation consistent covariance
matrix estimation. Econometrica 59, 817-858.

Bai, J. and P. Perron (1998). Estimating and testing linear models with multiple
structural changes. Econometrica 66, 47-78.

Bai, J. and P. Perron (2003). Computation and analysis of multiple structural change
models. Journal of Applied Econometrics 18, 1-22.

Harvey, A. C. (1978). Linear regression in the frequency domain. International Economic
Review 19, 507-512.

Yamamoto, Y. and P. Perron (2013). Estimating and testing multiple structural changes in
linear models using band spectral regressions. The Econometrics Journal 16, 400-429.

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

byperron v1.5.1 - July 2026

The tests implemented here were proposed by Yohei Yamamoto (Hitotsubashi University) and
Pierre Perron (Boston University) in Yamamoto and Perron (2013). byperron is a
Stata/Mata port of the original MATLAB code bsr_codes, developed by Yohei Yamamoto
and distributed on Pierre Perron's codes page at Boston University; the full spectrum
method implements the procedures of Bai and Perron (1998, 2003).

Please cite as:

Eruygur, H. O. 2026. byperron: Determining structural breaks in time series models
(Bai-Perron 2003; Yamamoto-Perron 2013). Stata package version 1.5.1. Available from:
https://www.eruygurakademi.com.