MyNixOS website logo
Description

Fourier ARDL Methods: Quantile, Nonlinear, Multi-Threshold & Unit Root Tests.

Comprehensive implementation of advanced ARDL methodologies for cointegration analysis with structural breaks and asymmetric effects. Includes: (1) Fourier Quantile ARDL (FQARDL) - quantile regression with Fourier approximation for analyzing relationships across the conditional distribution; (2) Fourier Nonlinear ARDL (FNARDL) - asymmetric cointegration with partial sum decomposition following Shin, Yu & Greenwood-Nimmo (2014) <doi:10.1007/978-1-4899-8008-3_9>; (3) Multi-Threshold NARDL (MTNARDL) - multiple regime asymmetry analysis; (4) Fourier Unit Root Tests - ADF and KPSS tests with Fourier terms following Enders & Lee (2012) <doi:10.1016/j.econlet.2012.05.019> and Becker, Enders & Lee (2006) <doi:10.1111/j.1467-9892.2006.00490.x>. Features automatic lag and frequency selection, PSS bounds testing following Pesaran, Shin & Smith (2001) <doi:10.1002/jae.616>, bootstrap cointegration tests, Wald tests for asymmetry, dynamic multiplier computation, and publication-ready visualizations. Ported from Stata/Python by Dr. Merwan Roudane.

fqardl: Fourier ARDL Methods for R

CRAN Status R-CMD-check License: GPL v3

Comprehensive ARDL methodologies for cointegration analysis with structural breaks and asymmetric effects.

🎯 Overview

fqardl provides a complete suite of advanced ARDL (Autoregressive Distributed Lag) methods for time series econometric analysis. Originally ported from Stata/Python implementations by Dr. Merwan Roudane.

✨ Features

MethodDescriptionReference
FQARDLFourier Quantile ARDLQuantile effects with smooth breaks
FNARDLFourier Nonlinear ARDLAsymmetric effects (Shin et al., 2014)
MTNARDLMulti-Threshold NARDLMultiple regime asymmetry
Fourier ADFUnit root testEnders & Lee (2012)
Fourier KPSSStationarity testBecker, Enders & Lee (2006)

Key Capabilities

  • 📊 Automatic selection of lags and Fourier frequencies (AIC/BIC/HQ)
  • 🔄 Asymmetric decomposition into positive/negative partial sums
  • 📈 PSS bounds testing for cointegration (Pesaran et al., 2001)
  • 🎲 Bootstrap cointegration tests for robust inference
  • 📉 Dynamic multipliers with confidence intervals
  • 📋 Publication-ready tables and visualizations

📦 Installation

From CRAN (when available)

install.packages("fqardl")

From GitHub

# install.packages("devtools")
devtools::install_github("muhammedalkhalaf/fqardl")

🚀 Quick Start

Fourier Unit Root Test

library(fqardl)

# Fourier ADF test for unit root with structural breaks
result <- fourier_adf_test(y, model = "c", max_freq = 3)
print(result)

# Complete analysis (ADF + KPSS)
analysis <- fourier_unit_root_analysis(y, name = "GDP")

Fourier Nonlinear ARDL (Asymmetric Effects)

# Test for asymmetric effects of oil price on GDP
result <- fnardl(
  formula = gdp ~ oil_price + exchange_rate,
  data = macro_data,
  decompose = c("oil_price"),  # Decompose into + and -
  max_k = 3,
  max_p = 4,
  max_q = 4
)

summary(result)
plot(result, type = "asymmetry")
plot(result, type = "dynamic", variable = "oil_price")

Fourier Quantile ARDL (Quantile Effects)

# Analyze effects across the distribution
result <- fqardl(
  formula = gdp ~ inflation + interest_rate,
  data = macro_data,
  tau = c(0.1, 0.25, 0.5, 0.75, 0.9),
  max_k = 3,
  bootstrap = TRUE
)

summary(result)

Multi-Threshold NARDL (Multiple Regimes)

# Multiple threshold analysis
result <- mtnardl(
  formula = stock_return ~ oil_change,
  data = market_data,
  decompose = "oil_change",
  thresholds = list(oil_change = c(-5, 0, 5)),  # 4 regimes
  max_p = 4,
  max_q = 4
)

summary(result)

📐 Theoretical Background

NARDL (Shin et al., 2014)

Decomposes independent variable into positive and negative partial sums:

x⁺ₜ = Σ max(Δxⱼ, 0)
x⁻ₜ = Σ min(Δxⱼ, 0)

Error Correction Model:

Δyₜ = α + ρyₜ₋₁ + θ⁺x⁺ₜ₋₁ + θ⁻x⁻ₜ₋₁ + short-run dynamics + εₜ

Long-run multipliers: L⁺ = -θ⁺/ρ, L⁻ = -θ⁻/ρ

Fourier Approximation (Enders & Lee, 2012)

Captures smooth structural breaks using trigonometric terms:

sin(2πkt/T) and cos(2πkt/T)

where k is the optimal frequency selected by minimizing information criterion.

📊 Output Example

=================================================================
   Fourier Nonlinear ARDL (FNARDL) - Summary
=================================================================

MODEL SPECIFICATION
-------------------
Dependent: gdp
Decomposed: oil_price
Fourier k: 2 | Lags: ARDL(3, 2)

ASYMMETRIC LONG-RUN MULTIPLIERS
-------------------------------
oil_price(+): -0.3421
oil_price(-):  0.5678
  Asymmetry test: Wald = 12.453, p = 0.0004 (Asymmetric)

BOUNDS TEST
-----------
F-stat: 8.2341 | Decision: Cointegration exists

ERROR CORRECTION TERM
---------------------
ECT (phi): -0.2156
Half-life: 2.87 periods
=================================================================

📚 References

  • Shin, Y., Yu, B., & Greenwood-Nimmo, M. (2014). Modelling Asymmetric Cointegration and Dynamic Multipliers in a Nonlinear ARDL Framework. In: Festschrift in Honor of Peter Schmidt. Springer.

  • Enders, W., & Lee, J. (2012). The flexible Fourier form and Dickey-Fuller type unit root tests. Economics Letters, 117(1), 196-199.

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

  • Pesaran, M. H., Shin, Y., & Smith, R. J. (2001). Bounds testing approaches to the analysis of level relationships. Journal of Applied Econometrics, 16(3), 289-326.

👨‍💻 Authors

  • Muhammad Alkhalaf - R implementation - ORCID
  • Dr. Merwan Roudane - Original Stata/Python implementation

🏢 Affiliation

Rufyq Elngeh (رفيق النجاح) - Academic & Business Services
🌐 www.rufyqelngeh.com

📄 License

GPL-3 © Muhammad Alkhalaf.

Metadata

Version

1.0.2

License

Unknown

Platforms (80)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows