Learn R Programming

FCUSUM (version 1.0.0)

fcum: Fourier CUSUM Cointegration Test

Description

Implements the Fourier CUSUM test for cointegration with structural breaks. The test uses Fourier approximations to model smooth structural changes and applies CUSUM statistics to test for cointegration stability.

Usage

fcum(y, x, kstar = 3)

Value

An object of class fcum containing:

statistic

The CUSUM test statistic

critical_values

Critical values at 1%, 5%, and 10% significance levels

p

Number of regressors used for critical value lookup

k

Frequency parameter used for critical value lookup

kstar

Maximum frequency parameter (user input)

best_frequency

Optimal frequency selected by AICc criterion

decision

Test decision (reject or fail to reject null hypothesis)

significance

Significance level indicator (*, **, ***)

best_model

The best fitting lm model object

call

The matched function call

Arguments

y

Numeric vector or matrix. Dependent variable time series.

x

Numeric vector or matrix. Independent variable(s) time series. Must have the same number of observations as y.

kstar

Positive numeric value. Maximum frequency parameter for Fourier approximation. Determines the flexibility of structural break modeling. Default is 3.

Details

The null hypothesis is that there exists a cointegrating relationship with stable parameters. The alternative hypothesis is that the cointegrating relationship is unstable or does not exist.

The test searches over a grid of frequencies from 0.1 to kstar and selects the optimal frequency using the corrected Akaike Information Criterion (AICc). The CUSUM statistic is then computed from the residuals of the best model.

Critical values are based on simulation studies and depend on:

  • The number of regressors (p)

  • The frequency parameter (k)

References

Zaghdoudi, T. (2025). Fourier CUSUM Cointegration Test Methodology.

Examples

Run this code
# Generate sample data
set.seed(123)
n <- 100
x <- cumsum(rnorm(n))
y <- 2 + 1.5 * x + rnorm(n)

# Run the test
result <- fcum(y, x, kstar = 3)
print(result)
summary(result)

Run the code above in your browser using DataLab