*! version 1.0 11mar2026

Title

fourierlm -- Fourier LM unit root test with flexible Fourier form

Syntax

fourierlm
varname
[if] [in]
[, options]

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

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

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

ic(#) information criterion for lag selection: 1=AIC, 2=SIC, 3=t-statistic; default is ic(3)

graph display plot of observed series overlaid with Fourier expansion

Description

fourierlm implements the Fourier LM unit root test proposed by
Enders and Lee (2012a). This test extends the
Schmidt-Phillips (1992) LM unit root test by incorporating a flexible Fourier
form to capture unknown structural breaks in the deterministic trend.

The key advantage of this approach is that the Fourier approximation can capture
the essential characteristics of an unknown number of structural breaks without
specifying their number, dates, or functional form. Unlike dummy variable approaches,
this method does not require pre-testing for break locations and avoids the associated
nuisance parameter problem.

The data must be tsset before using this command.

Options

kmax(#) specifies the maximum integer frequency to consider in the Fourier
approximation. Becker, Enders, and Lee (2006) recommend using small values of
k (typically up to 5) to capture low-frequency structural breaks.
Larger frequencies tend to capture short-run dynamics rather than structural breaks.
Default is kmax(5).

k(#) specifies a fixed Fourier frequency. When k(0) (the default),
the optimal frequency is selected by minimizing the sum of squared residuals (SSR)
over k = 1, ..., kmax. Setting a specific value bypasses the search.

pmax(#) specifies the maximum number of augmented lags to include for
correcting serial correlation. Default is pmax(8).

ic(#) specifies the information criterion used to select the optimal lag
length: 1 = Akaike Information Criterion (AIC), 2 = Schwarz
Information Criterion (SIC/BIC), 3 = sequential t-statistic method at 10%
significance level. Default is ic(3).

graph displays a plot with two lines: the observed time series (blue, thin)
and the fitted Fourier expansion series (red, thick). This visualization shows how
well the Fourier deterministic component captures the smooth structural changes
in the data.

Methodology

The Fourier LM test is based on the following data-generating process:

y_t = d_t + e_t, where e_t = rho * e_ + epsilon_t

The deterministic component d_t is approximated using a Fourier expansion:

d_t = c_0 + c_1*t + alpha*sin(2*pi*k*t/T) + beta*cos(2*pi*k*t/T)

The LM test regression (in first differences) is:

Delta(y_t) = d_1 + d_2*t + d_3*sin(2*pi*k*t/T) + d_4*cos(2*pi*k*t/T)
+ phi*S_ + sum_^

a_j*Delta(y_) + u_t

where S_ is the de-trended series from a first-stage regression. The null
hypothesis is H0: phi = 0 (unit root). The test statistic is the t-ratio on phi.

Optimal frequency k* is determined by minimizing the SSR of the LM regression
over k = 1, ..., kmax. An F-test for the joint significance of the Fourier terms
(alpha = beta = 0) is also reported.

Interpretation

Null hypothesis: The series has a unit root.

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

Decision rule: Reject the null if the LM statistic is more negative than
the critical value at the chosen significance level.

F-test: Before interpreting the LM statistic, check the F-test for nonlinearity.
If the F-test cannot reject H0: alpha = beta = 0, the Fourier terms are not significant,
and the standard LM unit root test (without Fourier terms) should be preferred.

Frequency interpretation: Optimal frequency k = 1 suggests a single smooth
structural change over the sample period. Higher values of k indicate more frequent
or complex changes.

Cautions:

1. This test assumes smooth structural breaks. For sharp or instantaneous
breaks, dummy-based tests (e.g., Zivot-Andrews) may be more appropriate.

2. Power may be reduced if the true DGP does not contain nonlinear
deterministic components. Always check the F-test.

3. The test requires sufficient sample size. Small samples (T < 50)
may produce unreliable results.

Stored results

fourierlm stores the following in r():

Scalars

r(LMk) LM test statistic

r(k) optimal Fourier 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

Basic LM test with defaults

. fourierlm gnp96

LM test with AIC lag selection and graph

. fourierlm gnp96, ic(1) graph

LM test with fixed frequency k=2

. fourierlm gnp96, k(2)

Return stored results

. return list

References

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.

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.

Schmidt, P. and Phillips, P.C. (1992). LM tests for a unit root in the
presence of deterministic trends. Oxford Bulletin of Economics and
Statistics, 54(3), 257-287.

Authors

Dr. Merwan Roudane

Email: merwanroudane920@gmail.com

Also see

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