*! version 2.0 11mar2026

Title

fourierall -- Run all Fourier unit root and stationarity tests

Syntax

fourierall
varname
[if] [in]
[, options]

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

kmax(#) maximum Fourier frequency; default is kmax(5)

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

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

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

notrend equivalent to model(1)

graph display graphs from all tests

Description

fourierall is a convenience command that runs all six Fourier-based unit root
and stationarity tests sequentially on the specified variable. It provides a
comprehensive assessment of the unit root hypothesis using multiple methodologies.

The command runs:

1. fourierlm - Fourier LM test (Enders & Lee, 2012a)

2. fourierdf - Fourier ADF test (Enders & Lee, 2012b)

3. fouriergls - Fourier GLS test (Rodrigues & Taylor, 2012)

4. fourierkpss - Fourier KPSS stationarity test (Becker, Enders & Lee, 2006)

5. fourierfffff - FFFFF-DF test (Omay, 2015)

6. fourierdfdf - Double Frequency Fourier DF test (Cai & Omay, 2021)

The data must be tsset before using this command.

Options

Options are passed through to the individual test commands as appropriate.
Not all options apply to all tests:

model(#): Passed to fourierdf, fouriergls, fourierkpss, fourierfffff, fourierdfdf.
Not used by fourierlm (which has no model option).

kmax(#): Passed to fourierlm, fourierdf, fouriergls, fourierkpss.

k(#): Passed to fourierlm, fourierdf, fouriergls, fourierkpss.
Not passed to fourierfffff (uses kfr) or fourierdfdf (uses dk, ks, kc).

pmax(#): Passed to fourierlm, fourierdf, fouriergls, fourierfffff, fourierdfdf.

ic(#): Passed to fourierlm, fourierdf, fouriergls, fourierfffff, fourierdfdf.

graph: Passed to all tests.

Test summary

Understanding the six tests:

Test H0 Frequency Method

fourierlm Unit root Integer LM (SP-type)
fourierdf Unit root Integer ADF (OLS)
fouriergls Unit root Integer ADF (GLS)
fourierkpss Stationarity Integer KPSS
fourierfffff Unit root Fractional ADF (OLS)
fourierdfdf Unit root Double ADF (OLS)

Note: The KPSS test (test 4) has the opposite null hypothesis.
Rejecting the KPSS null means the series is not stationary, which is
consistent with not rejecting the unit root null in the other tests.

Interpretation guidelines

Recommended decision strategy:

Step 1: Examine whether Fourier terms are significant (F-test in fourierdf,
fourierfffff, fourierdfdf). If not significant for any test, compare with
standard (non-Fourier) unit root tests.

Step 2: Compare unit root test results (tests 1-3, 5-6). Concordance
across multiple tests strengthens the conclusion.

Step 3: Check the KPSS test (test 4) for confirmation. If the KPSS test
rejects stationarity AND the unit root tests fail to reject, there is strong
evidence of a unit root.

Step 4: Use the graph option to visually inspect the Fourier fits.
A good fit between the Fourier expansion and the observed series supports the
validity of the Fourier-based tests.

Important warnings:

1. Different tests may disagree. This is normal and reflects differences
in methodology and power. Give more weight to GLS-based tests (fouriergls)
for power, and to LM tests (fourierlm) for robustness to initial conditions.

2. The DFDF test with dk(0.1) is the most powerful but also the most
computationally intensive. It is run with default dk(1) (integer frequencies)
via fourierall. For maximum power, run fourierdfdf separately with
dk(0.1).

3. All tests require the data to be tsset. Gaps in the time series
may produce unreliable results.

4. Minimum recommended sample size: T >= 50.

Examples

Run all tests with defaults

. sysuse gnp96, clear

. tsset date

. fourierall gnp96

Run all tests with graphs

. fourierall gnp96, graph

Run all tests with constant-only model

. fourierall gnp96, notrend

Run individual test separately for more control

. fourierdfdf gnp96, dk(0.1) bootstrap breps(500) graph

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.

Authors

Dr. Merwan Roudane

Email: merwanroudane920@gmail.com

Also see

Help: fourierlm, fourierdf, fouriergls,
fourierkpss, fourierfffff, fourierdfdf