*! version 1.0 21may2026

Title

fourierur -- Flexible Fourier Form unit root and stationarity tests (main command)

Quick navigation: individual test help files

Click any link below to jump straight to that test's help file:

[1] fourierlm Fourier LM unit root test (Enders & Lee, 2012a)

[2] fourierdf Fourier ADF unit root test (Enders & Lee, 2012b)

[3] fouriergls Fourier GLS unit root test (Rodrigues & Taylor, 2012)

[4] fourierkpss Fourier KPSS stationarity test (Becker, Enders & Lee, 2006)

[5] fourierfffff Fractional-frequency FFFFF-DF test (Omay, 2015)

[6] fourierdfdf Double-frequency Fourier DF + sieve bootstrap (Cai & Omay, 2021; Gerolimetto & Magrini, 2026)

Syntax

fourierur
varname
[if] [in]
[, test(name) other_options]

where name selects which test to run:

test(name)

lm run fourierlm

df run fourierdf

gls run fouriergls

kpss run fourierkpss

fffff run fourierfffff

dfdf run fourierdfdf

all run all six tests in sequence (default)

other_options

model(#) deterministic specification: 1=constant, 2=constant+trend; default model(2)

notrend equivalent to model(1)

kmax(#) maximum Fourier frequency (integer for most tests); default kmax(5)

k(#) fixed frequency; default k(0) = data-driven

pmax(#) maximum lag order; default pmax(8)

ic(#) lag-selection criterion: 1=AIC, 2=SIC, 3=t-stat; default ic(3)

graph draw the Fourier-fit graph for the selected test(s)

kfmin(#) (fffff only) lower bound of fractional grid; default 0.1

kfmax(#) (fffff only) upper bound of fractional grid; default 2.0

kfstep(#) (fffff only) grid step; default 0.1

kfr(#) (fffff only) fixed fractional frequency; default 0 = data-driven

noftest (fffff only) suppress F-test on Fourier terms

dk(#) (dfdf only) frequency step; 1=integer, 0.1=fractional; default dk(1)

bootstrap (dfdf only) compute sieve-bootstrap critical values

breps(#) (dfdf only) bootstrap replications; default breps(500)

varname must be tsset as a time-series variable.

Description

fourierur is the single main command of the fourierur package.
It provides a unified interface to six Fourier-based unit root and
stationarity tests that use a Flexible Fourier Form (FFF) to approximate
unknown smooth structural breaks.

With test(name) you pick one test to run; with test(all)
(the default) it runs all six tests sequentially and prints a comparative
summary. Each test can also still be called directly by name — see the
links at the top of this help file.

Test summary

Quick reference for the six tests:

test() Command H0 Frequency Method

lm fourierlm Unit root Integer LM (SP-type)
df fourierdf Unit root Integer ADF (OLS)
gls fouriergls Unit root Integer ADF (GLS)
kpss fourierkpss Stationarity Integer KPSS
fffff fourierfffff Unit root Fractional ADF (OLS)
dfdf fourierdfdf Unit root Double ADF (OLS) + boot

Note: fourierkpss has the reversed null hypothesis.
Rejecting the KPSS null = evidence the series is not stationary, which
is consistent with failing to reject the unit-root null in the other five
tests.

Interpretation guidelines

Recommended decision strategy:

Step 1. Check whether the Fourier terms are significant (F-test in
fourierdf, fourierfffff, fourierdfdf). If the
Fourier component is not significant, compare results to standard
(non-Fourier) unit root tests such as dfuller / dfgls /
kpss.

Step 2. Compare the unit-root tests (lm, df, gls, fffff, dfdf).
Concordance across tests strengthens the conclusion.

Step 3. Confirm with the KPSS stationarity test. UR tests fail to
reject and KPSS rejects ==> strong evidence of a unit root. UR tests
reject and KPSS fails to reject ==> strong evidence of stationarity.

Step 4. Use graph to visually inspect the Fourier fit. A close
fit supports the validity of the Fourier-based tests.

Practical notes:

- Different tests may disagree. Give more weight to GLS-based tests
for power, and to LM tests for robustness to initial conditions.

- fourierdfdf with dk(0.1) is the most powerful but the
most computationally expensive. Under test(all) it runs with the
default dk(1). For maximum power call fourierur with
test(dfdf) dk(0.1) (or call fourierdfdf directly).

- All tests require tsset. Gaps in the time series may give
unreliable results.

- Minimum recommended sample size: T >= 50.

Examples

Setup

. sysuse gnp96, clear

. tsset date

Run all six tests (default)

. fourierur gnp96

. fourierur gnp96, test(all) graph

Run a single test by name

. fourierur gnp96, test(lm)

. fourierur gnp96, test(df) graph

. fourierur gnp96, test(gls) notrend

. fourierur gnp96, test(kpss) graph

. fourierur gnp96, test(fffff) kfstep(0.05) kfmax(3) graph

. fourierur gnp96, test(dfdf) dk(0.1) graph

Maximum-power DFDF with sieve-bootstrap critical values

. fourierur gnp96, test(dfdf) dk(0.1) bootstrap breps(500) graph

Constant-only model on all tests

. fourierur gnp96, test(all) notrend

Stored results

When test() selects a single test, fourierur returns the
underlying test's r() results unchanged, plus:

Macros

r(test) name of the test that was run (lm, df,
gls, kpss, fffff, dfdf, or all)

For test(all) only r(test) = "all" is returned; consult each
sub-command's help for its own r() results.

References

Becker, R., Enders, W., and Lee, J. (2006). A stationarity test in the
presence of an unknown number of smooth breaks. Journal of Time Series
Analysis, 27(3), 381-409.

Cai, Y. and Omay, T. (2021). Using double frequency in Fourier Dickey-Fuller
unit root test. Computational Economics, 59, 445-470.

Enders, W. and Lee, J. (2012a). A unit root test using a Fourier series to
approximate smooth breaks. Oxford Bulletin of Economics and Statistics,
74(4), 574-599.

Enders, W. and Lee, J. (2012b). The flexible Fourier form and Dickey-Fuller
type unit root tests. Economics Letters, 117(1), 196-199.

Gerolimetto, M. and Magrini, S. (2026). Bootstrap double frequency Dickey
Fuller test for unit roots. Rivista Italiana di Economia Demografia e
Statistica, LXXX(3), 332-342.

Omay, T. (2015). Fractional frequency flexible Fourier form to approximate
smooth breaks in unit root testing. Economics Letters, 134, 123-126.

Rodrigues, P.M. and Taylor, A.R. (2012). The flexible Fourier form and local
generalised least squares de-trended unit root tests. Oxford Bulletin of
Economics and Statistics, 74(5), 736-759.

Author

Dr. Merwan Roudane

Email: merwanroudane920@gmail.com

Also see

Individual test help:

fourierlm - Fourier LM (Enders & Lee 2012a)

fourierdf - Fourier ADF (Enders & Lee 2012b)

fouriergls - Fourier GLS (Rodrigues & Taylor 2012)

fourierkpss - Fourier KPSS (Becker, Enders & Lee 2006)

fourierfffff - FFFFF-DF (Omay 2015)

fourierdfdf - Double-frequency Fourier DF (Cai & Omay 2021)