*! version 1.0 11mar2026

Title

fourierdf -- Fourier ADF unit root test with flexible Fourier form

Syntax

fourierdf
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 observed vs. Fourier expansion plot

Description

fourierdf implements the Fourier ADF (Augmented Dickey-Fuller) unit root test
proposed by Enders and Lee (2012b). It extends the standard
ADF test by incorporating trigonometric (Fourier) terms to capture unknown smooth
structural breaks in the deterministic component.

This approach approximates the time-varying deterministic trend using a Fourier
expansion, avoiding the need to pre-specify the number, dates, or form of structural
breaks. The optimal frequency is selected by minimizing the SSR.

The data must be tsset before using this command.

Options

model(#) specifies the deterministic component: model(1) includes
only a constant; model(2) includes both constant and linear trend. Default
is model(2).

kmax(#) specifies the maximum integer frequency for the grid search.
Default is kmax(5).

k(#) fixes the Fourier frequency. Default k(0) performs data-driven
selection via SSR minimization.

pmax(#) maximum number of augmented lags. Default is pmax(8).

ic(#) information criterion: 1=AIC, 2=SIC, 3=sequential
t-statistic. Default is ic(3).

notrend equivalent to specifying model(1). Excludes the linear trend
from the deterministic component.

graph displays a plot of the observed series (blue) overlaid with the
Fourier fitted deterministic component (red).

Methodology

The Fourier ADF test is based on the augmented regression:

Delta(y_t) = c_0 [+ c_1*t] + alpha*sin(2*pi*k*t/T) + beta*cos(2*pi*k*t/T)
+ rho*y_ + sum_^

phi_j*Delta(y_) + epsilon_t

The null hypothesis H0: rho = 0 is tested using the t-ratio on the coefficient
of y_. Under H0, the asymptotic distribution depends on the frequency k
and the deterministic specification. Critical values are tabulated in Enders and
Lee (2012b).

The F-test for the significance of the Fourier terms (H0: alpha = beta = 0)
is used to determine whether a nonlinear deterministic component exists. If the
F-test fails to reject, the standard ADF test without Fourier terms is preferred.

Interpretation

Null hypothesis: The series contains a unit root.

Alternative: The series is stationary around a Fourier deterministic trend.

Decision rule: Reject H0 if the ADF statistic is more negative than the
critical value.

Important warnings:

1. If the F-test does not reject linearity, use a standard ADF test instead.
Using Fourier terms when they are not needed reduces power.

2. The test has higher power for smooth breaks than for sharp/instantaneous breaks.

3. Critical values depend on the frequency k. Using the wrong critical values
(e.g., from a standard ADF table) will lead to incorrect inference.

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

Stored results

fourierdf stores the following in r():

Scalars

r(ADFk) ADF test statistic

r(k) optimal frequency

r(p) optimal lag order

r(Fk) F-statistic for Fourier terms

r(cv1) 1% critical value

r(cv5) 5% critical value

r(cv10) 10% critical value

Examples

Setup

. sysuse gnp96, clear

. tsset date

ADF test with constant and trend (default)

. fourierdf gnp96

ADF test with constant only

. fourierdf gnp96, notrend

ADF test with graph

. fourierdf gnp96, graph

References

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

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.

Authors

Dr. Merwan Roudane

Email: merwanroudane920@gmail.com

Also see

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