| Title: | Comprehensive Cointegration Tests with Fourier and Panel Methods |
|---|---|
| Description: | A unified toolkit for cointegration testing including Fourier-based cointegration tests (FADL, FEG, FEG2, Tsong) that accommodate smooth structural breaks via flexible Fourier terms, and panel CADF cointegration tests with structural breaks using the Common Correlated Effects (CCE) estimator following Banerjee, Arcabic and Lee (2017) <doi:10.1016/j.econmod.2017.03.004>, Tsong, Lee, Tsai and Hu (2016) <doi:10.1007/s00181-015-1028-6>, and Banerjee and Carrion-i-Silvestre (2025) <doi:10.1080/07350015.2024.2327844>. |
| Authors: | Muhammad Abdullah Alkhalaf [aut, cre, cph] (ORCID: <https://orcid.org/0009-0002-2677-9246>) |
| Maintainer: | Muhammad Abdullah Alkhalaf <[email protected]> |
| License: | GPL-3 |
| Version: | 1.0.0 |
| Built: | 2026-05-28 07:23:02 UTC |
| Source: | https://github.com/muhammedalkhalaf/cointests |
Implements four Fourier-based cointegration tests that accommodate smooth structural breaks via flexible Fourier terms: FADL, FEG, FEG2, and Tsong.
fcoint(y, x, test = c("fadl", "feg", "feg2", "tsong", "all"), model = c("constant", "trend"), max_freq = 5L, max_lag = 0L, criterion = c("aic", "bic"), dols_lags = 0L)fcoint(y, x, test = c("fadl", "feg", "feg2", "tsong", "all"), model = c("constant", "trend"), max_freq = 5L, max_lag = 0L, criterion = c("aic", "bic"), dols_lags = 0L)
y |
Numeric vector. Dependent (left-hand side) time-series variable. |
x |
Numeric matrix or vector. Independent (right-hand side) variables. |
test |
Character. Which test to run: |
model |
Character. Deterministic component: |
max_freq |
Integer. Maximum Fourier frequency to search over (1–5).
Default is |
max_lag |
Integer. Maximum lag order. |
criterion |
Character. Information criterion for lag selection:
|
dols_lags |
Integer. Leads and lags for the DOLS estimator used in
the Tsong test. Default is |
The Fourier approach allows for smooth, nonlinear breaks in the deterministic components by augmenting standard cointegration regressions with one or more pairs of sine and cosine terms.
FADL (Banerjee, Arcabic & Lee, 2017):
An ADL-type residual-based test. The optimal Fourier frequency
and lag order are chosen jointly by minimising the selected information
criterion over a grid.
FEG and FEG2 (Banerjee & Lee):
Engle-Granger style residual-based tests augmented with Fourier terms.
FEG2 includes an additional correction.
Tsong et al. (2016):
A DOLS-based cointegration test with Fourier terms. Reports both a
CI statistic and an -statistic for joint significance of Fourier
terms.
A list of class "fcoint" containing:
Character. Name(s) of the test(s) performed.
Named list of individual test results.
Character. Deterministic component used.
Character. Information criterion used.
Integer. Effective number of observations.
Banerjee, P., Arcabic, V., & Lee, H. (2017). Fourier ADL cointegration test to approximate smooth breaks with new evidence from crude oil market. Economic Modelling, 67, 114–124. doi:10.1016/j.econmod.2017.03.004
Tsong, C.-C., Lee, C.-F., Tsai, L.-J., & Hu, T.-C. (2016). The Fourier approximation and testing for the null of cointegration. Empirical Economics, 51(3), 1085–1113. doi:10.1007/s00181-015-1028-6
set.seed(42) n <- 80 x <- cumsum(rnorm(n)) y <- 0.5 * x + rnorm(n, sd = 0.3) res <- fcoint(y, x, test = "fadl", max_freq = 3) print(res)set.seed(42) n <- 80 x <- cumsum(rnorm(n)) y <- 0.5 * x + rnorm(n, sd = 0.3) res <- fcoint(y, x, test = "fadl", max_freq = 3) print(res)
Prints a formatted summary of Fourier cointegration test results.
## S3 method for class 'fcoint' print(x, ...)## S3 method for class 'fcoint' print(x, ...)
x |
An object of class |
... |
Further arguments passed to or from other methods (unused). |
Invisibly returns x.
set.seed(1) n <- 60 x <- cumsum(rnorm(n)) y <- 0.5 * x + rnorm(n) res <- fcoint(y, x, test = "fadl", max_freq = 2) print(res)set.seed(1) n <- 60 x <- cumsum(rnorm(n)) y <- 0.5 * x + rnorm(n) res <- fcoint(y, x, test = "fadl", max_freq = 2) print(res)
Prints a formatted summary of an "xtcadfcoint" result.
## S3 method for class 'xtcadfcoint' print(x, ...)## S3 method for class 'xtcadfcoint' print(x, ...)
x |
An object of class |
... |
Additional arguments (ignored). |
Invisibly returns x.
Prints a summary of an "xtcadfcoint" result.
## S3 method for class 'xtcadfcoint' summary(object, ...)## S3 method for class 'xtcadfcoint' summary(object, ...)
object |
An object of class |
... |
Additional arguments (ignored). |
Invisibly returns object.
Tests the null hypothesis of no cointegration in panel data using the cross-sectionally augmented Dickey-Fuller (CADF) approach of Banerjee and Carrion-i-Silvestre (2025). Accounts for cross-sectional dependence via the Common Correlated Effects (CCE) estimator and allows for structural breaks.
xtcadfcoint(formula, data, index, model = 1, breaks = 0, trimming = 0.15, maxlags = 4, lagselect = "bic", nfactors = 1, brk_slope = FALSE, brk_loadings = FALSE, cce = TRUE, simulate = 0, level = 95)xtcadfcoint(formula, data, index, model = 1, breaks = 0, trimming = 0.15, maxlags = 4, lagselect = "bic", nfactors = 1, brk_slope = FALSE, brk_loadings = FALSE, cce = TRUE, simulate = 0, level = 95)
formula |
A formula of the form |
data |
A data frame in long format. |
index |
Character vector of length 2: |
model |
Integer (0-5) specifying the deterministic component. |
breaks |
Integer (0, 1, or 2). Number of structural breaks. |
trimming |
Numeric. Trimming fraction for break date search. Default 0.15. |
maxlags |
Maximum lag order for ADF augmentation. Default 4. |
lagselect |
Lag selection: |
nfactors |
Integer. Number of common factors for CCE. Default 1. |
brk_slope |
Logical. Allow breaks in cointegrating vector slopes. |
brk_loadings |
Logical. Allow breaks in factor loadings. |
cce |
Logical. Apply CCE augmentation. Default |
simulate |
Integer. Bootstrap replications for critical values (0 = skip). |
level |
Confidence level in percent. Default 95. |
An object of class "xtcadfcoint" containing panel CIPS statistics,
individual CADF statistics, estimated break dates, and coefficient estimates.
Banerjee, A. and Carrion-i-Silvestre, J.L. (2024). Panel Data Cointegration Testing with Structural Instabilities. Journal of Business & Economic Statistics, 43, 122–133. doi:10.1080/07350015.2024.2327844
set.seed(42) n <- 5; tt <- 30 uid <- rep(1:n, each = tt) tval <- rep(1:tt, times = n) x_it <- cumsum(rnorm(n * tt)) y <- x_it + rnorm(n * tt, sd = 0.5) dat <- data.frame(id = uid, time = tval, y = y, x = x_it) res <- xtcadfcoint(y ~ x, data = dat, index = c("id", "time"), model = 1) print(res)set.seed(42) n <- 5; tt <- 30 uid <- rep(1:n, each = tt) tval <- rep(1:tt, times = n) x_it <- cumsum(rnorm(n * tt)) y <- x_it + rnorm(n * tt, sd = 0.5) dat <- data.frame(id = uid, time = tval, y = y, x = x_it) res <- xtcadfcoint(y ~ x, data = dat, index = c("id", "time"), model = 1) print(res)