Title

xtfpanic methods -- Methods and formulas for xtfpanic

Fourier detrending

Let dXt be the first differences. A flexible Fourier trend is removed
from each series by regressing dXit on the differenced deterministic
terms dzt, where

zt = [ t, cos(2 pi k t/T), sin(2 pi k t/T) : k=1..m ]

and m is the maximum cumulative frequency (freq()). The residuals
rrit are the Fourier-detrended differences.

Common factors

The number of common factors is estimated by the Bai-Ng (2002) information
criterion on rr, and the factors F-hat and loadings are extracted by
principal components (the shared xtflexur engine). The idiosyncratic
component is wwit = dXit - Fourier fit - F-hat loadings.

Fourier-LM statistic

For each unit, the cumulated idiosyncratic component Sit = sum ww is
tested with a score-type LM regression

dXit = phi Si,t-1 + dzt g + F-hat d + sum_j cj dSi,t-j + uit,

and the statistic is the t-ratio on phi. The lag order is chosen by AIC,
SIC, or a general-to-specific t-test (default). Including dz and F-hat as
regressors purges the smooth break and the common factors.

p-values and pooling

The distribution of the Fourier-LM statistic depends on the sample size, the
number of lags, and the frequency m. The paper's response surface gives the
critical value at each of 221 percentiles as
CV = c1 + c2/T + c3/T^2 + c4(p/T) + c5(p/T)^2 (p = lags), tabulated
separately for m = 0, 1, 2, 3. A local MacKinnon (1996) inversion returns the
p-value pi, and the individual p-values are pooled into

P = -2 sum ln(pi) ~ chi-square(2N),

Pm = (P - 2N)/sqrt(4N) ~ N(0,1),

both rejecting the unit-root null for large values.

Step-to-code map

computation

Fourier detrending of differences Mata _xtfp_run

factors (Bai-Ng 2002) Mata _xtfp_pca / _xtfp_fnumber2

Fourier-LM statistic + lags Mata _xtfp_lmtau

response-surface p-value Mata _xtfp_pval (+ _xtfp_rs0..3)

pooled P and Pm Mata _xtfp_run

Each block reproduces the GAUSS code appl3_PANIC_fourier; the
statistics and p-values match Table 3 of Nazlioglu et al. (2023) (both m=1 and
m=1,2) to the last reported digit.

Reference

Nazlioglu, S., et al. 2023. Smooth structural changes and common factors in
nonstationary panel data. Econometric Reviews 42(1): 78-97.

Back to xtfpanic | xtflexur library