MyNixOS website logo
Description

Two-Stage Detection and Attribution of Cross-Border Financial Contagion Channels.

Implementation of a two-stage framework for the joint detection-and-attribution of cross-border financial contagion. Stage one detects directional information flows between equity markets via Wavelet-Quantile Transfer Entropy, combining maximal-overlap discrete wavelet decomposition (Percival and Walden, 2000, ISBN:9780521685085) with the transfer-entropy estimator of Schreiber (2000) <doi:10.1103/PhysRevLett.85.461> and quantile conditioning following Han, Linton, Oka and Whang (2016) <doi:10.1016/j.jeconom.2016.03.001>. Stage two attributes each significant directional link to one of five mutually exclusive transmission channels (Trade, Financial, Geopolitical, Behavioural, Monetary Policy) through a multi-method structural identification architecture combining instrumental-variables two-stage least squares with channel-specific external instruments (Stock and Watson, 2018) <doi:10.1111/ecoj.12593>, LASSO-based instrument selection (Belloni, Chernozhukov and Hansen, 2014) <doi:10.1093/restud/rdt044>, local projections (Jorda, 2005) <doi:10.1257/0002828053828518>, heteroskedasticity-based identification (Rigobon, 2003) <doi:10.1162/003465303772815727>, and the Cinelli-Hazlett (2020) <doi:10.1111/rssb.12348> robustness-value sensitivity bound. Bundled datasets and replication scripts reproduce the headline findings of Bhandari, Parida and Sahu (2026) <doi:10.48550/arXiv.2604.26546>; the package is general-purpose and accommodates user-supplied returns and channel proxies.

contagionchannels

Two-Stage Detection and Attribution of Cross-Border Financial Contagion Channels

License: GPL-3 R-CMD-check arXiv Lifecycle: experimental

contagionchannels is an R package implementing the two-stage framework for the joint detection and attribution of cross-border financial contagion developed in Bhandari, Parida and Sahu (2026), arXiv:2604.26546. The framework first detects directional information flows between equity markets via Wavelet-Quantile Transfer Entropy and then attributes each significant directional link to one of five mutually exclusive transmission channels — Trade, Financial, Geopolitical, Behavioural, Monetary Policy — through a multi-method structural-identification architecture.

Highlights

  • Stage 1: Wavelet-Quantile Transfer Entropy (WQTE) over a six-scale MODWT decomposition and three quantile levels, with absolute-thresholding to construct directed contagion networks.
  • Stage 2: Five complementary identification strategies for channel attribution:
    • Instrumental-variables / Two-Stage Least Squares with channel-specific external instruments — Stock & Watson (2018) doi:10.1111/ecoj.12593
    • LASSO instrument selection — Belloni, Chernozhukov & Hansen (2014) doi:10.1093/restud/rdt044
    • Local projections at h=1, 5, 22 days — Jordà (2005) doi:10.1257/0002828053828518
    • Heteroskedasticity-based identification — Rigobon (2003) doi:10.1162/003465303772815727
    • Cinelli-Hazlett (2020) robustness-value sensitivity — doi:10.1111/rssb.12348
  • Bundled datasets: 18 G20 equity markets × 5,036 daily log-returns (Jan 2006 – Mar 2026); 14 channel proxies; 8 crisis sub-period definitions.
  • Three vignettes: full paper replication; methodology overview; using with custom datasets.

Installation

From source (the package is not yet on CRAN):

# install.packages("devtools")
devtools::install_local("path/to/contagionchannels", build_vignettes = TRUE)

Or directly from the source tarball:

install.packages("contagionchannels_0.1.3.tar.gz", repos = NULL, type = "source")

Quick start

library(contagionchannels)

# Load bundled data
d <- load_paper_data()

# Build the five channel composites
channels <- build_channel_composites(d$proxies)

# Run the full pipeline (Stage 1 detection + Stage 2 attribution)
res <- run_contagion_pipeline(d$returns, channels, d$periods,
                               scale = 5, tau = 0.50, n_cores = 4)

# Per-period channel-attribution shares
res$period_shares
#>            Period Trade Financial Geopolitical Behavioral Monetary  Dominant
#> 1       PreCrisis   8.8      35.9          9.4       13.8     32.1 Financial
#> 2             GFC  27.9      15.0         27.0        2.9     27.2     Trade
#> 3            ESDC  13.7      39.5         19.0       19.6      8.1 Financial
#> 4             CSC  15.9      21.6         15.6       21.7     25.3  Monetary
#> 5        PreCOVID  18.1      31.6          8.2       13.5     28.6 Financial
#> 6           COVID  18.7      18.3         27.5        8.2     27.2 Geopolit.
#> 7          RusUkr  22.6      23.4          6.1       20.3     27.6  Monetary
#> 8 MidEastTariffs   27.6      26.8          7.5        6.3     31.8  Monetary

Key functions

FunctionPurpose
compute_wqte_matrix()Stage-1 pairwise Wavelet-Quantile Transfer Entropy
build_channel_composites()Construct five channel composites from raw proxies
iv_2sls_attribute()Stage-2 IV/2SLS attribution per significant link
lasso_iv_attribute()LASSO IV variant per Belloni-Chernozhukov-Hansen
local_projections()Jordà 2005 local projections at multiple horizons
rigobon_id()Heteroskedasticity-based identification
cinelli_hazlett_rv()Robustness-value sensitivity bound
build_network()Construct directed contagion network from QTE matrix
walktrap_communities()Pons-Latapy community detection
run_contagion_pipeline()End-to-end wrapper

Bundled datasets

ObjectDescription
g20_returnsxts of daily log-returns: 5,036 days × 18 markets
channel_proxiesdata.frame of 14 channel-proxy time series
crisis_periodsNamed list of 8 crisis sub-period date ranges

Vignettes

vignette("replication", package = "contagionchannels")  # Reproduce the paper
vignette("methodology", package = "contagionchannels")  # Methodology overview
vignette("custom_data", package = "contagionchannels")  # Use custom datasets

Replication scripts

The package includes a standalone replication suite at system.file("scripts", package = "contagionchannels"). To reproduce every numerical result and figure:

master <- system.file("scripts", "99_replicate_paper.R",
                       package = "contagionchannels")
source(master)

Citation

If you use the package in published work, please cite the methodology paper:

Bhandari, A., Parida, I., & Sahu, H. K. (2026). What Drives Contagion? Identifying and Attributing Cross-Border Transmission Mechanisms. arXiv preprint arXiv:2604.26546.

@misc{bhandari2026contagion,
  title         = {What Drives Contagion? Identifying and Attributing
                   Cross-Border Transmission Mechanisms},
  author        = {Bhandari, Avishek and Parida, Ipsita and Sahu, Hitesh Kumar},
  year          = {2026},
  eprint        = {2604.26546},
  archivePrefix = {arXiv},
  primaryClass  = {q-fin.ST},
  url           = {https://arxiv.org/abs/2604.26546}
}

@manual{contagionchannels2026,
  title    = {contagionchannels: Two-Stage Detection and Attribution of
              Cross-Border Financial Contagion Channels},
  author   = {Bhandari, Avishek and Parida, Ipsita and Sahu, Hitesh Kumar},
  year     = {2026},
  note     = {R package version 0.1.3},
  url      = {https://github.com/avishekb9/contagionchannels}
}

License

GPL-3 © Bhandari, Parida & Sahu (2026), Indian Institute of Technology Bhubaneswar.

Metadata

Version

0.1.3

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