*! version 1.1.0 08mar2026

Title

fcoint -- Fourier cointegration tests for time series with smooth
structural breaks

Syntax

fcoint depvar indepvars [if] [in],
test(testname)
[options]

Required
test(testname) test to run: fadl, feg, feg2,
tsong, or all

Model specification
model(string) deterministic: constant (default) or
trend

maxfreq(#) max Fourier frequency; default is 5

maxlag(#) max lag length; default = 6 (FADL) or
auto (others)

criterion(string) info criterion: aic (default) or
bic

cumfreq use cumulative frequencies (q = 1, ..., maxfreq)

dols(#) DOLS leads/lags for Tsong test; 0 = auto

Output
graph produce diagnostic graphs

Description

fcoint implements four Fourier-based cointegration tests for time-series
data. The tests use low-frequency Fourier (trigonometric) components to
approximate smooth structural breaks of unknown form in the deterministic
trend, without needing to estimate the number, timing, or form of breaks.

This is important because conventional cointegration tests (Engle-Granger,
Johansen, ADL) can fail to detect cointegration when the equilibrium
relationship has undergone smooth structural shifts — such as gradual policy
changes, evolving market structures, or slow institutional reforms.

The key idea is that a Fourier expansion sin(2kt/T) +
cos(2kt/T) can approximate virtually any smooth deterministic
function, including functions with multiple breaks and nonlinear shifts
(Gallant, 1981). This avoids the pitfalls of dummy-variable approaches, which
require pre-specifying break dates and forms.

Available Tests

FADL — Fourier ADL Test

Reference: Banerjee, Arcabic & Lee (2017, Economic Modelling)

Null hypothesis: No cointegration (H0: delta = 0)

Alternative: Cointegration (H1: delta < 0)

The FADL test extends the conditional error-correction (ADL) framework of
Banerjee, Dolado & Mestre (1998) by adding Fourier terms to the deterministic
component. The regression is:

Dy_t = c + [trend] + g1*sin(2kt/T) + g2*cos(2kt/T)
+ delta*y_ + gamma'*x_ + phi'*Dx_t + lags + e_t

The t-statistic on delta is the FADL test statistic. Rejection (large
negative value) implies cointegration after controlling for Fourier breaks.

Advantages: (1) single-step procedure (no residual estimation); (2) allows
for weak exogeneity; (3) includes both short-run and long-run dynamics.

Lag Selection: Nested grid search over Dy lags and each Dx_i lag separately,
using AIC or BIC. This matches the original WinRATS code exactly.

FEG — Fourier Engle-Granger Test

Reference: Banerjee & Lee (Working Paper)

Null: No cointegration. Alternative: Cointegration.

Two-step residual-based test:

Step 1: Estimate long-run equation with Fourier deterministics:

y_t = c + [trend] + g1*sin(...) + g2*cos(...) + x_t'*beta + mu_t

Step 2: ADF test on residuals (no constant):

D(mu_hat_t) = delta*mu_hat_ + sum(alpha_i*D(mu_hat_)) + v_t

The t-statistic on delta is the FEG test statistic.

Lag selection: General-to-specific — start with maxlag, drop last lag if
|t| < 1.645, repeat.

FEG2 — Modified Fourier EG Test

Reference: Banerjee & Lee (Working Paper), Eq. (8)

Null: No cointegration. Alternative: Cointegration.

The FEG2 test augments the FEG testing regression with Dx_{2,t} to address
the common factor restriction (CFR). The standard EG test implicitly assumes
that short-run and long-run coefficients are identical. When this is violated,
the EG test loses power. The FEG2 test resolves this:

D(mu_hat_t) = c + delta*mu_hat_ + Dx_{2,t}'*tau + epsilon_t

The critical values depend on rho-squared, the long-run squared
correlation between v_t (FEG error) and epsilon_t (FEG2 error), estimated via
Bartlett kernel. When rho-sq = 1, FEG2 reduces to FEG.

When to use FEG2 over FEG: Always recommended. FEG2 is never worse than
FEG, and significantly more powerful when the signal-to-noise ratio is high or
when CFR is violated. The paper recommends FEG2 for all empirical applications.

Tsong — Null of Cointegration Test

Reference: Tsong, Lee, Tsai & Hu (2016, Empirical Economics)

Null: Cointegration EXISTS. Alternative: No cointegration.

IMPORTANT: The Tsong test reverses the null hypothesis! This is a KPSS-type
test where the null is that cointegration holds (with possible Fourier breaks).
Rejection means the variables are NOT cointegrated.

The test uses DOLS (Dynamic OLS) estimation with leads and lags of Dx to handle
non-strict exogeneity:

y_t = d(t) + x_t'*beta + sum(Dx_'*phi_i) + epsilon*_t

CI_f = T^{-2} * omega_hat^{-2} * sum(S*_t^2)

where S*_t is the partial sum of DOLS residuals and omega_hat^2 is the
long-run variance estimated via Bartlett kernel.

Also reports an F-test for the significance of the Fourier component. If the
F-test is insignificant, the Shin (1994) test without Fourier terms should be
used instead.

When to use: To confirm cointegration findings. Running both an H0:
no-coint test (FADL/FEG/FEG2) and an H0: coint test (Tsong) provides stronger
evidence than either alone.

Options in Detail

Required

test(testname) specifies which test to run. Options:

fadl — FADL cointegration test (Banerjee et al. 2017). Best for general
use. Single-step, allows weak exogeneity.

feg — Fourier Engle-Granger. Two-step residual-based test. Simple and
familiar to practitioners.

feg2 — Modified FEG. Recommended over FEG in all cases. Controls for
common factor restriction.

tsong — Null of cointegration (KPSS-type). Reverses hypothesis direction.
Use for confirmation.

all — Runs all four tests sequentially for comprehensive analysis.

Model Specification

model(constant) includes only intercept + Fourier terms in the
deterministic component. Use when the underlying equilibrium has no trend.

model(trend) includes intercept, linear trend, and Fourier terms. Use when
variables exhibit trending behavior in levels.

maxfreq(#) maximum single Fourier frequency k. The optimal k* is selected
by minimizing SSR across k = 1, ..., maxfreq. Default is 5, but papers
recommend k <= 3 for most applications since low frequencies capture breaks
while high frequencies may capture noise.

maxlag(#) maximum lag length for the grid search (FADL) or
general-to-specific (FEG/FEG2). Default:

FADL: 6 (matching WinRATS code)

FEG/FEG2: int(12*(T/100)^0.25)

criterion(aic|bic) information criterion for lag selection. AIC tends to
select more lags (better size in finite samples); BIC tends to select fewer lags
(more parsimonious).

cumfreq uses cumulative frequencies q = 1, ..., maxfreq instead of a
single frequency. Each q includes ALL frequencies from 1 to q:

d(t) = c + g1*sin(2t/T) + g2*cos(2t/T) + g3*sin(4t/T) +
g4*cos(4t/T) + ...

Cumulative frequencies can approximate more complex break patterns but consume
degrees of freedom. Papers recommend q <= 2 in most cases.

dols(#) number of leads and lags in DOLS estimation for the Tsong test.
Set to 0 for automatic AIC-based selection (default). Typical values: 1-4.

graph produces diagnostic graphs showing the Fourier deterministic fit
overlaid on the dependent variable, plus residual plots.

Methodology

Fourier approximation. A key result from approximation theory (Gallant,
1981) states that a finite number of Fourier frequencies can closely approximate
any integrable function. The deterministic component is:

d(t) = c + [gamma*t] + sum_^ [a_j*sin(2j*t/T) +
b_j*cos(2j*t/T)]

where T is the sample size and q is the number of cumulative frequencies. Even
a single frequency (q = 1) can capture a wide variety of smooth break patterns.

Frequency selection. The optimal frequency k* is chosen by minimizing the
sum of squared residuals (SSR) from the estimation equation. This is equivalent
to maximizing the fit of the Fourier component and is the approach recommended
in all three papers.

Single vs. cumulative frequencies. Use single frequency for simple break
patterns (one smooth shift). Use cumulative when breaks are complex or
multiple. Start with single frequency and only switch to cumulative if results
are sensitive.

Critical Values

FADL and FEG critical values (Banerjee et al. 2017, Tables 1-2):

Depend on: n (number of regressors), k (frequency), T (sample
size).

Available for: n = 1-3, k = 1-5, T = 100, 500, 2500.

Interpolated for intermediate T values.

Lower-tail test: reject H0 if t-stat < critical value.

FEG2 critical values (Banerjee & Lee, Tables 1a-1d):

Depend on: n, k, T, AND rho-squared.

Available for: rho-sq = 0.1, 0.2, ..., 1.0.

Lower-tail test: reject H0 if t-stat < critical value.

When rho-sq is close to 1, FEG2 CVs approach FEG CVs.

Tsong critical values (Tsong et al. 2016, Table 1):

Depend on: p (number of regressors), k (frequency), m (0 =
constant, 1 = constant + trend).

Upper-tail test: reject H0 if statistic > critical value.

Available for: p = 1-4, k = 1-3.

F-test critical values for Fourier component significance:

m = 0: 10% = 3.352, 5% = 4.066, 1% = 5.774

m = 1: 10% = 3.306, 5% = 4.019, 1% = 5.860

Interpretation Guide

Case 1: FADL/FEG/FEG2 reject, Tsong does not reject

Strong evidence of cointegration with Fourier breaks. Both the no-coint
null (FADL/FEG/FEG2) and the coint null (Tsong) point in the same direction.
This is the ideal confirmatory scenario.

Case 2: FADL/FEG/FEG2 reject, Tsong also rejects

Contradictory. This can occur with small samples or misspecification. Check
model specification, try different frequencies, or increase sample size. The
FADL test is generally more reliable due to its single-step nature.

Case 3: FADL/FEG/FEG2 do not reject, Tsong rejects

Evidence against cointegration. Both directions suggest no long-run
equilibrium. Consider whether the variables are even I(1) — run unit root tests
first.

Case 4: None reject

Inconclusive. Failure to reject H0 in both directions. The tests may lack
power. Consider larger samples, different model specifications, or the
possibility that the relationship is genuinely ambiguous.

Interpreting the optimal frequency k*:

k* = 1: One smooth, gradual break over the sample period.

k* = 2: Two cycles or a U-shaped shift.

k* = 3+: Complex break patterns. Be cautious — high frequencies may be
capturing noise rather than genuine structural change.

Interpreting rho-squared (FEG2):

rho-sq near 0: Variance reduction from Dx augmentation is large. FEG2 is much
more powerful than FEG.

rho-sq near 1: Little variance reduction. FEG2 and FEG have similar power. CFR
holds approximately.

Interpreting the Fourier F-test (Tsong):

F significant: Fourier breaks are present. Use Tsong/FADL/FEG tests.

F not significant: No evidence of Fourier breaks. Consider using standard Shin
(1994) or Engle-Granger tests instead.

Requirements and Constraints

Data Requirements

1. Data must be tsset (time-series declared).

2. All variables must be I(1). Run dfuller or pperron first.

3. No gaps in the time series (balanced panel).

4. Stata 14.0 or higher required.

FADL Test Constraints

Regressors (n): 1 to 3. Critical values available for n = 1, 2, 3.

Frequency (k): 1 to 5.

Sample size (T): minimum 50 recommended, T >= 100 for reliable inference.

Critical values interpolated between T = 100 and T = 500.

Lag search: Dy and each Dx searched independently (1 to maxlag).

FEG Test Constraints

Regressors (n): 1 to 3 (uses FADL critical values).

Frequency (k): 1 to 5.

Sample size (T): minimum 50, T >= 100 recommended.

Lag selection: general-to-specific (drops last lag if |t| < 1.645).

Note: Two-step procedure; requires super-consistent first stage.

FEG2 Test Constraints

Regressors (n): 1 to 2 only (critical values limited to n = 1, 2).

Frequency (k): 1 to 5.

Sample size (T): minimum 50, T >= 100 recommended.

Additional parameter: rho-sq (estimated, range 0.1 to 1.0).

Note: Requires at least 2 variables total (depvar + 1 regressor).

Tsong Test Constraints

Regressors (p): 1 to 4. Critical values for p = 1, 2, 3, 4.

Frequency (k): 1 to 3 only (critical values limited).

Sample size (T): minimum 50 recommended; DOLS leads/lags consume observations.

DOLS lags: auto-selected or user-specified via dols(#).

Bandwidth: Bartlett kernel with bw = int(T^{1/3}).

Note: Upper-tail test (large statistic rejects cointegration).

Summary Table

Test Max n Max k Min T Null

FADL 3 5 50 No cointegration
FEG 3 5 50 No cointegration
FEG2 2 5 50 No cointegration
Tsong 4 3 50 Cointegration

Warnings and Practical Notes

WARNING 1: Pre-test for unit roots.

All cointegration tests require that the variables are I(1) (integrated of
order one). If variables are I(0) or I(2), the tests are invalid. Run
dfuller or pperron on each variable before using fcoint.

WARNING 2: Tsong test has reversed hypotheses.

The Tsong test has H0: cointegration, unlike FADL/FEG/FEG2 which have H0: no
cointegration. A large Tsong statistic rejects cointegration. Do not
confuse the direction.

WARNING 3: Small sample sizes.

With T < 100, the tests may have poor size properties, especially with many
frequencies or lags. The papers recommend T >= 100 for reliable inference. With
T < 50, results should be interpreted with extreme caution.

WARNING 4: Number of regressors.

Critical values are provided for n = 1-3 regressors (FADL/FEG) and p = 1-4
(Tsong). If you have more regressors, the program uses the closest available
critical values, but results may be less accurate.

WARNING 5: High frequencies.

The papers strongly recommend keeping the frequency low (k <= 3 for most
applications). High frequencies (k = 4, 5) consume degrees of freedom and may
capture noise rather than genuine structural breaks. Becker et al. (2006)
argue that even k = 1 is sufficient for most economic applications.

WARNING 6: Cumulative frequencies.

With multiple cumulative frequencies, the number of extra parameters grows
quickly (2q extra parameters). Use q <= 2 in most cases unless you have a
very large sample.

NOTE 1: No estimation of break dates.

The Fourier approach is designed to control for breaks, not to estimate them.
If you need break date estimates, use conventional structural break tests (e.g.,
estat sbsingle, Bai-Perron tests).

NOTE 2: FADL vs FEG.

The FADL test is generally preferred over FEG because: (1) it does not require
super-consistent estimation of the long-run equation; (2) it allows for weak
exogeneity; (3) it has better finite-sample properties.

NOTE 3: Standard errors.

The test statistics are non-standard — do not use conventional p-values. Only
compare with the tabulated critical values.

Examples

Example 1: Basic FADL test

. tsset time, monthly

. fcoint y x1 x2, test(fadl)

Example 2: FADL with trend and BIC

. fcoint y x1 x2, test(fadl) model(trend) criterion(bic)

Example 3: FADL with cumulative frequencies and graph

. fcoint y x1 x2, test(fadl) cumfreq maxfreq(3) graph

Example 4: FEG2 test (recommended over FEG)

. fcoint y x1, test(feg2)

Example 5: Tsong test (confirms cointegration)

. fcoint y x1 x2, test(tsong)

Example 6: Comprehensive analysis — all tests with graphs

. fcoint y x1 x2, test(all) graph

Example 7: Recommended workflow

Step 1: Test for unit roots

dfuller y, lags(4)

dfuller x1, lags(4)

dfuller x2, lags(4)

Step 2: Test for cointegration (H0: no coint)

fcoint y x1 x2, test(fadl) graph

fcoint y x1 x2, test(feg2)

Step 3: Confirm (H0: coint)

fcoint y x1 x2, test(tsong)

Step 4: Check robustness

fcoint y x1 x2, test(fadl) model(trend)

fcoint y x1 x2, test(fadl) criterion(bic)

fcoint y x1 x2, test(fadl) cumfreq

Stored Results

fcoint with test(fadl) stores in r():

Scalars

r(tstat) FADL t-statistic (t^F_ADL)

r(delta) estimated error-correction coefficient

r(se_delta) standard error of delta

r(frequency) optimal frequency k*

r(ssr) sum of squared residuals at optimum

r(nobs) number of observations used

r(lag_dy) optimal Dy lag length

r(lag_dx) optimal Dx lag length

r(eg_tstat) companion Fourier EG t-statistic

r(eg_lag) companion EG optimal lag

r(cv1) 1% critical value

r(cv5) 5% critical value

r(cv10) 10% critical value

Locals

r(test) "fadl"

r(model) model specification

r(criterion) information criterion used

fcoint with test(feg) or test(feg2):

r(tstat) FEG/FEG2 t-statistic

r(delta) ADF coefficient on mu_hat_

r(se_delta) standard error

r(frequency) optimal frequency k*

r(nobs) observations

r(lag) ADF lag length

r(rho2) estimated rho-squared (FEG2 only)

r(cv1) r(cv5) r(cv10) critical values

fcoint with test(tsong):

r(CI_stat) KPSS-type cointegration statistic

r(F_stat) F-test for Fourier component

r(omega2) estimated long-run variance

r(frequency) optimal frequency k*

r(nobs) observations

r(dolslags) DOLS leads/lags used

r(ci_cv1) r(ci_cv5) r(ci_cv10) CI critical values

r(f_cv1) r(f_cv5) r(f_cv10) F-test critical values

Graphs

When the graph option is specified, fcoint produces diagnostic
graphs:

FADL/FEG tests:

Panel 1: Dependent variable with Fourier deterministic fit overlaid.

Panel 2: Residuals from the long-run equation (should look stationary if
cointegrated).

Panel 3: Fourier component isolated (showing the smooth break pattern).

Tsong test:

Panel 1: DOLS fit vs actual.

Panel 2: CUSUM of DOLS residuals (should stay within bounds if cointegrated).

How to read the graphs:

If the Fourier fit closely tracks the dependent variable's long-run movement
(ignoring short-run noise), the Fourier terms are capturing genuine structural
shifts. If the residuals look stationary (mean-reverting), this supports
cointegration.

References

Banerjee, P., V. Arcabic, and H. Lee (2017).
Fourier ADL cointegration test to approximate smooth breaks with new evidence from Crude Oil Market.
Economic Modelling 67: 114-124.

Banerjee, P. and H. Lee.
Residual-based cointegration tests for smooth structural breaks.
Working Paper.

Tsong, C-C., C-F. Lee, L-J. Tsai, and T-C. Hu (2016).
The Fourier approximation and testing for the null of cointegration.
Empirical Economics 51: 1085-1113.

Enders, W. and J. Lee (2012).
A unit root test using a Fourier series to approximate smooth breaks.
Oxford Bulletin of Economics and Statistics 74: 574-599.

Becker, R., W. Enders, and J. Lee (2006).
A stationarity test in the presence of an unknown number of smooth breaks.
Journal of Time Series Analysis 27: 381-409.

Shin, Y. (1994).
A residual-based test of the null of cointegration against the alternative of no cointegration.
Econometric Theory 10: 91-115.

Banerjee, A., J. Dolado, and R. Mestre (1998).
Error-correction mechanism tests for cointegration in a single-equation framework.
Journal of Time Series Analysis 19: 267-283.

Saikkonen, P. (1991).
Asymptotically efficient estimation of cointegration regressions.
Econometric Theory 7: 1-21.

Gallant, A.R. (1981).
On the bias in flexible functional forms and an essentially unbiased form.
Journal of Econometrics 15: 211-245.

Author

Dr Merwan Roudane

merwanroudane920@gmail.com

Translated from WinRATS code by Banerjee, Arcabic & Lee.

Also see

Online: tsset, dfuller, pperron, vec,
estat sbsingle