*! version 1.0 11mar2026

Title

fouriergls -- Fourier GLS de-trended unit root test

Syntax

fouriergls
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

fouriergls implements the Fourier GLS (Generalized Least Squares) de-trended
unit root test proposed by Rodrigues and Taylor (2012).
This test combines the power advantages of GLS de-trending (Elliott, Rothenberg,
and Stock, 1996) with the flexibility of Fourier approximations for unknown
structural breaks.

GLS de-trending is known to produce unit root tests with superior power compared
to OLS-based tests (such as the standard ADF or Fourier ADF). The Fourier GLS
test applies local GLS de-trending with a c-bar parameter that depends on the
model specification, then tests for a unit root in the de-trended series.

The data must be tsset before using this command.

Options

model(#) specifies the deterministic component: model(1) includes
only a constant (c_bar = -7); model(2) includes constant and trend
(c_bar = -22). Default is model(2).

kmax(#) maximum Fourier frequency. Default is kmax(5).

k(#) fixed frequency. Default k(0) = data-driven selection.

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

ic(#) lag selection criterion. Default is ic(3).

notrend equivalent to model(1).

graph displays a plot of observed series vs. Fourier expansion.

Methodology

The Fourier GLS test proceeds in two stages:

Stage 1 - GLS de-trending: The series is de-trended using the local GLS
procedure. For model 2, the de-trending parameter c_bar = -22 (as recommended by
Elliott, Rothenberg, and Stock, 1996). The quasi-differenced series is regressed
on quasi-differenced deterministic components including Fourier terms.

Stage 2 - ADF test on residuals: An ADF regression is performed on the
GLS de-trended residuals to test for a unit root.

The test statistic is the t-ratio on the lagged de-trended series in the ADF
regression. Critical values depend on the frequency k and the model specification.

c-bar values: c_bar = -7 for model 1 (constant only), c_bar = -22 for
model 2 (constant + trend). These values maximize the local asymptotic power
of the test at the 50% power point.

Interpretation

Null hypothesis: The series has a unit root.

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

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

Power advantage: The GLS de-trending yields higher power than OLS-based
Fourier tests (fourierlm, fourierdf), especially in finite samples. This makes
fouriergls the most powerful single-frequency Fourier unit root test.

Important warnings:

1. GLS de-trending is designed for testing near the null hypothesis.
It may not perform well far from the null.

2. The c_bar parameter is model-specific. Using the wrong model
specification reduces power.

3. As with all Fourier tests, check whether Fourier terms are needed
before relying on the results.

Stored results

fouriergls stores the following in r():

Scalars

r(GLSk) GLS test statistic

r(k) optimal frequency

r(p) optimal lag order

r(cv1) 1% critical value

r(cv5) 5% critical value

r(cv10) 10% critical value

Examples

. sysuse gnp96, clear

. tsset date

. fouriergls gnp96

. fouriergls gnp96, model(1) graph

References

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.

Elliott, G., Rothenberg, T.J., and Stock, J.H. (1996). Efficient tests for
an autoregressive unit root. Econometrica, 64(4), 813-836.

Authors

Dr. Merwan Roudane

Email: merwanroudane920@gmail.com

Also see

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