*! version 1.0.0 05jun2026

Title

xtpfardl -- Fourier-augmented panel ARDL / CS-ARDL estimator

Syntax

xtpfardl
depvar indepvars
[if] [in]
[, options]

Model
model(type) estimator: csardl (default), mg, pmg, dfe

crlags(#) lags of cross-section averages; default crlags(3)

nocross omit cross-sectional averages (plain panel ARDL)

Lag structure
plags(#) short-run lags of D.depvar; default plags(1)

qlags(#) short-run lags of D.indepvars; default qlags(1)

lagsearch(#) select (p,q) by pooled BIC up to this maximum

Fourier
maxk(#) maximum Fourier frequency searched; default maxk(3)

k(#) fix the Fourier frequency (skip the search)

fractional search frequencies in steps of 0.1 (cumulative frequencies)

nofourier exclude Fourier terms (standard panel ARDL)

trend include a (heterogeneous) linear trend

Reporting
hausman report the PMG-vs-MG long-run poolability (Hausman) test

level(#) set confidence level; default level(95)

nograph suppress all graphs

graphprefix(string) filename prefix for exported .png graphs

nodiag suppress the diagnostics block

nocinfo suppress the long-run coefficient plot

xtpfardl requires the data to be xtset, and uses xtdcce2
(Ditzen) as the estimation engine. depvar and indepvars should be in
levels; the command builds the error-correction (UECM) form internally.

Description

xtpfardl estimates the Fourier-augmented panel ARDL family of models for
heterogeneous, cross-sectionally dependent panels with smooth structural breaks.
It augments the (cross-section augmented) panel ARDL with Enders-Lee Fourier
terms sin(2{&pi}kt/T) and cos(2{&pi}kt/T) that approximate an
unknown number of gradual breaks without pre-testing break dates.

The command reproduces the estimators introduced in:

o Ersin (2026) — Fourier-CS-ARDL (model(csardl)); and

o Sardarli & Suleymanli (2026) — Fourier Panel ARDL (model(pmg)/mg).

For every model xtpfardl reports a journal-style long-run table
(delta-method standard errors), the error-correction speed of adjustment
with the implied half-life, the short-run dynamics including the Fourier
terms, residual diagnostics (Fourier joint significance and a Pesaran CD
test via xtcd2), and publication-quality graphs (frequency selection
and a long-run coefficient plot).

To test Granger non-causality with the matching Fourier method, see xtfdh.

Options

Model

model(type) selects the estimator. See Models below.
csardl (the default) is the cross-section augmented ARDL of Chudik et al.
(2016) used by Ersin (2026); pmg is the pooled mean-group panel ARDL of
Pesaran, Shin & Smith (1999) used by Sardarli & Suleymanli (2026).

crlags(#) sets the number of lags of the cross-section averages used to
proxy the unobserved common factors (passed to xtdcce2). Chudik et al.
suggest of order T^(1/3); crlags(3) is a common choice.

nocross drops the cross-sectional averages, giving a plain (non-augmented)
panel ARDL. Use this to obtain a benchmark that ignores cross-sectional
dependence.

Lag structure

plags(#) and qlags(#) fix the short-run augmentation, i.e. the lags of
D.depvar and of D.indepvars. lagsearch(#) instead
selects (p,q) automatically by minimizing the pooled BIC over a grid up to the
stated maximum.

Fourier

maxk(#), k(#) and fractional govern the Fourier frequency. By
default xtpfardl selects the single optimal frequency k* over the integer
grid 1,...,maxk by minimum pooled sum of squared residuals (Yilanci,
Bozoklu & Gorus 2020). k(#) fixes the frequency; fractional searches
in 0.1 steps; nofourier removes the Fourier terms altogether.

Reporting

hausman estimates the model twice (pooled mean group and mean group) and
reports the Hausman test of long-run poolability (H0: long-run homogeneity).
Not rejecting H0 supports the more efficient pmg; rejecting favours mg.
The test is computed with the built-in hausman command on the
nlcom-posted long-run vectors.

graphprefix(string) prepends string to the exported PNG filenames
(stringxtpfardl_kstar.png and stringxtpfardl_lr.png).
nograph disables graph creation; nodiag and nocinfo suppress
the diagnostics block and the long-run plot, respectively.

Models

The four models share the one-step unrestricted error-correction (UECM)
representation and differ only in which coefficients are pooled:

csardl Fourier-CS-ARDL. All coefficients heterogeneous; equation
augmented with cross-section averages (Chudik et al. 2016; Ersin 2026). Default.

mg Fourier mean-group panel ARDL (CCE-MG); heterogeneous, optionally augmented.

pmg Fourier pooled mean-group panel ARDL; long-run pooled, dynamics
heterogeneous (Pesaran, Shin & Smith 1999; Sardarli & Suleymanli 2026).

dfe Fourier dynamic fixed-effects; all coefficients pooled.

Methodology

xtpfardl estimates, for each unit i = 1,...,N, the Fourier-augmented UECM

D.y(i,t) = c(i) + {&phi}(i)·y(i,t-1) + {&theta}(i)'x(i,t-1)
+ {&Sigma}{&psi}(i,j)·D.y(i,t-j) + {&Sigma}{&delta}(i,j)'D.x(i,t-j)
+ {&lambda}0(i)·sin(2{&pi}kt/T) + {&lambda}1(i)·cos(2{&pi}kt/T) + e(i,t),

augmented (in csardl/mg) with cross-section averages of all model
variables and their lags to remove unobserved common factors. The
long-run coefficients are recovered by the delta method as
{&beta}(x) = -{&theta}(x)/{&phi} (reported with nlcom-type standard errors),
and {&phi} is the error-correction speed of adjustment. The Fourier
frequency k* is chosen by minimum SSR; the joint significance of the sine and
cosine terms is reported as a Fourier nonlinearity test.

Recommended preliminary tests (separate commands): cross-sectional dependence
xtcd2; slope homogeneity; second-generation panel unit roots
xtcips; and panel cointegration xtwest / xtpedroni.

Examples

Setup

. webuse set https://www.stata-press.com/data/r17/

. xtset id year

Fourier-CS-ARDL (Ersin 2026 specification)

. xtpfardl co2 y ret etd, model(csardl) crlags(3)

Fourier Panel ARDL / PMG (Sardarli & Suleymanli 2026 specification)

. xtpfardl fcd fd f er inf, model(pmg) maxk(3)

Fix the frequency and search the lag orders by BIC

. xtpfardl y x z, model(mg) k(1) lagsearch(3)

Benchmark without Fourier terms or cross-section averages

. xtpfardl y x z, model(mg) nofourier nocross

Then test causality with the matching Fourier method

. xtfdh co2 y, lags(2)

Stored results

xtpfardl stores the following in e() (in addition to the
xtdcce2 engine results, which remain in e(b)/e(V)):

Scalars

e(N_g) number of groups

e(kstar) selected Fourier frequency

e(plags), e(qlags) short-run lag orders

e(crlags) cross-section average lags

e(ect_b), e(ect_se) speed of adjustment and its SE

Macros

e(cmd) xtpfardl

e(model) selected model

e(depvar), e(indepvars) dependent / long-run variables

e(lrnames) names of long-run coefficients

Matrices

e(lr_b), e(lr_V) long-run estimates and (delta-method) VCV

e(kgrid) Fourier frequency grid and SSR

The residual variable _xtpf_resid (common-factor partialled) is left
in memory for post-estimation use.

References

Bildirici, M., and F. Kay{&iacute}k{&ccedil}{&inodot}. 2022. Renewable energy and current
account balance nexus. Environmental Science and Pollution Research 29:
48759-48768. doi:10.1007/s11356-022-19286-9.

Bildirici, M., and F. {&Ccedil}oban Kay{&iacute}k{&ccedil}{&inodot}. 2024. Energy consumption,
energy intensity, economic growth, FDI, urbanization, PM2.5 concentrations
nexus. Environment, Development and Sustainability 26: 5047-5065.
doi:10.1007/s10668-023-02923-9.

Chudik, A., K. Mohaddes, M. H. Pesaran, and M. Raissi. 2016.
Long-run effects in large heterogeneous panel data models with cross-sectionally
correlated errors. Advances in Econometrics 36: 85-135.

Ditzen, J. 2021. Estimating long-run effects and the exponent of
cross-sectional dependence: An update to xtdcce2. Stata Journal 21: 687-707.

Ersin, {&Ouml}. {&Ouml}. 2026. Decoupling of CO2 emissions from growth with
energy transition and eco-innovations in OECD: Novel Fourier-CS-ARDL and
Fourier-DH-causality analyses. Sustainability 18(6): 2728.
doi:10.3390/su18062728.

Pesaran, M. H., Y. Shin, and R. P. Smith. 1999. Pooled mean group
estimation of dynamic heterogeneous panels. JASA 94: 621-634.

Sardarli, K., and J. Suleymanli. 2026. Modeling the dynamics of financial
dollarization under structural shifts in Latin America: The new Fourier panel
ARDL approach. Journal of Sustainable Development Issues 3(2): 117-137.
doi:10.62433/josdi.v3i2.68.

Yilanci, V., Bozoklu, {&Scaron}., and Gorus, M. S. 2020. Are BRICS
countries pollution havens? Evidence from a bootstrap ARDL bounds testing
approach with a Fourier function. Sustainable Cities and Society 55: 102035.

Also see

Help: xtfdh (Fourier-DH causality),
fbardl (time-series Fourier bootstrap ARDL),
xtdcce2, xtcd2, xtcips, xtwest

Author: Dr. Merwan Roudane

Email: merwanroudane920@gmail.com

GitHub: github.com/merwanroudane