Title

ffrals -- Flexible-Fourier LM unit-root test with RALS and factor
(RALS2) augmentation for non-normal errors

Commands in the ffrals library

ffrals flexible-Fourier LM test (rals(0/1/2))

ffadf flexible-Fourier ADF test (rals(0/1/2), det())

fflm2 two-break LM test (rals(0/1/2))

See help ffrals_hub for the library overview.

Syntax

ffrals varname [if] [in] [, options]

The series must be tsset.

rals(#) augmentation: 0 plain flexible-Fourier LM (default),
1 RALS, 2 RALS with common/group factors

factors(varlist) common and group factor variables (required with
rals(2))

fmax(#) maximum Fourier frequency to search (default 4)

pmax(#) maximum augmentation lag (default 8)

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

nsim(#) Monte-Carlo replications for the p-value (default 50000)

seed(#) random-number seed for the simulation (default 2345)

Description

ffrals implements the flexible-Fourier LM unit-root test of Lee, Islam,
Tieslau, Payne and Nazlioglu, in which an unknown number of smooth structural
breaks is approximated by a single Fourier frequency (chosen by minimum residual
sum of squares over 1..fmax) and the score-based LM statistic is computed by
augmented regression. With rals(1) the regression is augmented by the
residual-augmented least squares (RALS) terms, which exploit non-normality
of the errors to gain power without nuisance parameters. With rals(2) the
regression is further augmented by supplied common and group factors()
(the RALS2 factor test), making the test robust to cross-sectional dependence
when applied series-by-series to a panel.

The test statistic is the t-ratio on the lagged level in the augmented
LM regression, and rho-squared = the ratio of augmented to unaugmented error
variances measures the efficiency gain from the RALS terms. Because the null
distribution is non-standard (and, under RALS, depends on rho-squared),
ffrals computes the p-value and critical values by Monte-Carlo simulation
of the null distribution for the sample size at hand.

ffrals is part of the ffrals library of flexible-Fourier
+ RALS time-series unit-root tests. See help ffrals methods
for the formulas.

Options

rals(#): 0 the plain flexible-Fourier LM test; 1 adds the
RALS moment terms; 2 additionally includes the factors() for the
factor-augmented (RALS2) test.

factors(varlist): the common factor and the relevant group factor for
the series (required when rals(2)). These are appended to the augmented
regression exactly as the more matrix in the source routine.

fmax(#), pmax(#), ic(#): the maximum Fourier frequency
searched (default 4), the maximum lag (default 8) and the lag-selection rule
(1=AIC, 2=BIC, 3=general-to-specific t-test, the default).

nsim(#), seed(#): the number of Monte-Carlo replications
(default 50000) and the seed (default 2345) used to simulate the null
distribution. The test statistic does not depend on these; only the p-value
and critical values do.

Examples

Plain flexible-Fourier LM test:

. tsset year

. ffrals lgdp, rals(0)

RALS version (non-normal errors):

. ffrals lgdp, rals(1)

Factor-augmented RALS2 version with a common and a group factor:

. ffrals lgdp, rals(2) factors(fcommon fgroup)

Stored results

ffrals is rclass and stores:

Scalars

r(stat) test statistic

r(p) simulated p-value

r(freq) selected Fourier frequency

r(lag) selected augmentation lag

r(rho2) RALS rho-squared (rals(1)/rals(2))

r(cv1), r(cv5), r(cv10) simulated 1/5/10% critical values

r(N) number of observations

Interpreting the output

The null is a unit root. The statistic is a (negative) t-ratio and the test
rejects for values below the reported critical value (a large negative
statistic), i.e. in favour of a (trend-)stationary series around the estimated
smooth breaks. RALS (rals(1/2)) sharpens the test when the errors are
non-normal; the closer rho-squared is to zero, the larger the efficiency
gain.

A note on reproducibility

The test statistic, selected frequency, lag and rho-squared are exact and
match the source GAUSS routines to the last digit. The p-value and critical
values are obtained by Monte-Carlo simulation and therefore carry a small
simulation error (about 0.003 at 50,000 replications); increase nsim() for
more precision.

References

Lee, J., N. Islam, M. Tieslau, J. E. Payne, and S. Nazlioglu. 2026.
Relative commodity prices, smooth breaks, and non-normal errors: a RALS-Fourier
factor approach. Journal of International Money and Finance.

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

Meng, M., J. Lee, and J. E. Payne. 2017. RALS-LM unit root test with
trend breaks and non-normal errors. Applied Economics 49: 2277-2296.

Author

Dr Merwan Roudane

merwanroudane920@gmail.com

github.com/merwanroudane

Faithful Stata port of the GAUSS routines Fourier_LM,
Fourier_LM_RALS and Fourier_LM_RALS2 by S. Nazlioglu; the test
statistics were validated byte-for-byte against the GAUSS output and the p-values
reproduce the same Monte-Carlo construction.