Regime Discovery and Intra-Regime Return Dynamics in Global Equity Markets (Analysis codes and Supplementary results)
Abstract
This deposit contains the code and supporting materials used for regime identification and regime profiling in stock market indices using Hilbert–Huang–based signal processing methods. It also includes code for intra-regime return transition analysis using Variable-Length Markov Chains (VLMC) estimated via context trees. The materials support a comparative study of regime-dependent dynamics in developed and developing equity markets.Included files:Return categorization: Daily log returns for the 20 equity indices are computed and discretized into five quintile-based states for the VLMC analysis. Code: "Return_Categorization.ipynb".Regime identification and profiling: Hilbert–Huang Transform is used to obtain the Hilbert spectrum. From the spectrum’s instantaneous amplitudes, we compute the instantaneous energy and normalize it within each index. Using thresholds at μ+σ and μ+6σ on the normalized instantaneous energy, we label each trading day as Normal, High, or Extreme, and then construct the corresponding one-year regime windows. Regime profiling is then performed using Holo–Hilbert Spectral Analysis, with amplitude-modulation energy from the Holo–Hilbert spectrum serving as the volatility-intensity measure. Code: "HS_HHS.ipynb".Common regime-year selection: Common regime years across indices are computed separately for developed and developing market groups. Code: "RegimeYears_ThresholdRobustness.ipynb".VLMC estimation via context trees: Variable-Length Markov Chains are estimated for each index using context-tree methods implemented in the R package mixvlmc. Code: "VLMC_ContextTreeEstimation.r".VLMC metrics and intra-regime dynamics: Regime-specific transition dynamics are summarized using the VLMC metrics defined in the manuscript. Code: "VLMC_Metrics.ipynb".Robustness of regime thresholds: A sensitivity analysis is conducted to assess how the regime classification changes under alternative threshold choices applied to the normalized instantaneous energy series derived from the Hilbert spectrum. Code: "RegimeYears_ThresholdRobustness.". Outputs: [Market]_sensitivity_summary.csv: Long-format table summarizing, for every stock and (a, b) threshold pair, the number of days classified into Normal/High/Extreme and the number of distinct years assigned to each regime (after overlap removal). [Market]_common_years_by_threshold.txt: For each (a, b) threshold pair, lists the “common” years per regime across all stocks (intersection; if empty, the top-N most frequent years across stocks are reported as a fallback). [Market]_robustness_vs_baseline.csv: For every stock and (a, b) pair, reports robustness against the baseline (a=1, b=6) via day-level label agreement and Jaccard similarities of the Normal/High/Extreme year-sets.
Publication details
- Journal / source
- Figshare
- Publication date
- 7 January 2026