Module multifractal

Module multifractal 

Source
Expand description

Multifractal Analysis Module

Provides wavelet-based multifractal analysis for characterizing scaling behavior, long-range dependence, and singularity structure in signals. This module implements standard methods for Hurst exponent estimation and multifractal spectrum computation.

§Overview

Multifractal analysis reveals the complex scaling properties of signals that exhibit heterogeneous local regularity. Unlike monofractal signals characterized by a single Hurst exponent, multifractal signals require a spectrum of exponents to fully describe their scaling behavior.

§Key Concepts

§Hurst Exponent (H)

The Hurst exponent characterizes the long-range dependence and self-similarity of a signal:

  • H = 0.5: No long-range dependence (white noise, random walk)
  • 0.5 < H < 1.0: Persistent behavior (positive autocorrelation, trending)
  • 0 < H < 0.5: Anti-persistent behavior (negative autocorrelation, mean-reverting)

§Multifractal Spectrum

The multifractal spectrum f(α) describes the distribution of local singularity exponents α (Hölder exponents) in the signal:

  • Monofractal: Spectrum concentrated at single point
  • Multifractal: Spectrum spans range of values, indicating heterogeneous scaling

§Wavelet Leaders

Wavelet leaders are local suprema of wavelet coefficients that provide robust estimates of local regularity, superior to direct wavelet coefficient analysis.

§Applications

§Financial Markets

  • Volatility Persistence: Detect long-memory in volatility clustering
  • Market Efficiency: Assess deviation from random walk (H ≠ 0.5)
  • Risk Analysis: Characterize fat-tailed distributions via multifractality
  • Regime Detection: Identify shifts in scaling behavior

§Climate Science

  • Temperature Analysis: Long-term trends and persistence
  • Precipitation Patterns: Multiscale variability
  • Drought Analysis: Long-memory in hydrological processes

§Hydrology

  • River Flow: Persistence and anti-persistence in flow rates
  • Flood Prediction: Long-range dependence detection

§Neuroscience

  • EEG/fMRI Analysis: Brain signal complexity
  • Neural Dynamics: Multiscale temporal patterns

§Geophysics

  • Seismic Activity: Earthquake clustering and memory
  • Turbulence: Multifractal cascade processes

§Methods

This module implements three complementary approaches:

  1. Hurst Exponent Estimation (estimate_hurst_exponent)

    • Based on variance scaling of DWT/MODWT coefficients
    • Linear regression in log-log plot of variance vs scale
    • Provides confidence intervals via bootstrap
  2. Wavelet Leaders Multifractal Analysis (multifractal_spectrum)

    • Computes singularity spectrum f(α) via wavelet leaders
    • Estimates structure functions at multiple moments
    • More robust than WTMM for heavy-tailed processes
  3. Scaling Exponents (scaling_exponents)

    • Analyzes scale-by-scale behavior
    • Detects departures from self-similarity
    • Useful for identifying regime changes

§See Also

  • High-level user guide: docs/USER_GUIDE.md
  • Wavelet families and recommended choices for Hurst/multifractal work: docs/WAVELET_FAMILIES.md
  • Advanced analysis overview (coherence, matching pursuit, multifractal): docs/ADVANCED_ANALYSIS.md
  • Mathematical validation and references: MATHEMATICAL_VALIDATION.md

§Quick Start

use iron_wave::analysis::multifractal::*;
use iron_wave::{Signal, Wavelet};
use iron_wave::wavelets::{Daubechies, DaubechiesType};

// Create a signal (e.g., financial returns, climate data)
let data: Vec<f64> = (0..1024)
    .map(|i| (i as f64 * 0.1).sin() + 0.2 * (i as f64).sqrt())
    .collect();
let signal = Signal::new(data);

// Choose wavelet (Daubechies recommended for Hurst estimation)
let wavelet = Daubechies::new(DaubechiesType::Db4);

// Estimate Hurst exponent
let hurst_result = estimate_hurst_exponent(&signal, &wavelet, None)?;
println!("Hurst exponent: {:.3} ± {:.3}",
         hurst_result.hurst_exponent,
         hurst_result.confidence_interval);

// Interpret result
if hurst_result.hurst_exponent > 0.5 {
    println!("Signal shows persistent behavior (long-memory)");
} else if hurst_result.hurst_exponent < 0.5 {
    println!("Signal shows anti-persistent behavior (mean-reverting)");
} else {
    println!("Signal behaves like random walk");
}

// Compute multifractal spectrum
let config = MultifractalConfig::default();
let spectrum = multifractal_spectrum(&signal, &wavelet, config)?;

// Check if signal is multifractal
let spectrum_width = spectrum.alpha_max - spectrum.alpha_min;
if spectrum_width > 0.2 {
    println!("Signal exhibits strong multifractality (width: {:.3})", spectrum_width);
} else {
    println!("Signal is approximately monofractal");
}

§Mathematical Background

§Hurst Exponent via Wavelets

For a self-similar process with Hurst exponent H, the variance of wavelet coefficients at scale j follows:

Var(d_j) ∝ 2^(2jH)

Taking logarithms:

log₂(Var(d_j)) = 2jH + C

The Hurst exponent is estimated via linear regression of log-variance against scale j.

§Wavelet Leaders

The wavelet leader at scale 2^j and position k is:

L(j,k) = sup_{λ' ⊂ 3λ(j,k)} |d_{λ'}|

where the supremum is taken over all wavelets λ' in a neighborhood of λ(j,k).

§Structure Functions

For moment q, the structure function is:

S(j,q) = (1/n_j) Σ_k L(j,k)^q

The scaling exponent ζ(q) satisfies:

S(j,q) ∝ 2^(j·ζ(q))

§Multifractal Spectrum

The singularity spectrum f(α) is obtained via Legendre transform:

α(q) = dζ(q)/dq
f(α(q)) = qα(q) - ζ(q)

In this crate we implement the Wavelet Leader Multifractal (WLMF) formalism following Wendt, Abry, and Jaffard, using cone-based leaders (suprema over spatial neighborhoods and finer scales), structure functions S(j, q), and a Legendre-transform-based spectrum f(α). For an applied example of this methodology on geophysical time series, see Toledo et al. (2013) on wavelet-based multifractal analysis of nonlinear tsunami time series.

§References

  1. Abry, P., & Veitch, D. (1998). “Wavelet Analysis of Long-Range-Dependent Traffic.” IEEE Transactions on Information Theory, 44(1), 2-15.

  2. Jaffard, S., Lashermes, B., & Abry, P. (2007). “Wavelet Leaders in Multifractal Analysis.” In Wavelet Analysis and Applications (pp. 219-264). Birkhäuser Basel.

  3. Wendt, H., Abry, P., & Jaffard, S. (2007). “Bootstrap for Empirical Multifractal Analysis.” IEEE Signal Processing Magazine, 24(4), 38-48.

  4. Mallat, S. (2008). A Wavelet Tour of Signal Processing: The Sparse Way. Academic Press. (Chapter 6: Multifractal Analysis)

  5. Flandrin, P. (1992). “Wavelet Analysis and Synthesis of Fractional Brownian Motion.” IEEE Transactions on Information Theory, 38(2), 910-917.

  6. Toledo, B. et al. (2013). “Wavelet-based multifractal analysis of nonlinear time series: the earthquake-driven tsunami of 27 February 2010 in Chile.”

Structs§

HurstResult
Result of Hurst exponent estimation
MultifractalConfig
Configuration for multifractal analysis
MultifractalSpectrum
Result of multifractal spectrum computation
WaveletLeaderDiagnostics
Convenience diagnostics for wavelet-leader scaling.
WaveletLeaderScaling
Raw wavelet-leader scaling data.

Functions§

estimate_hurst_exponent
Estimate Hurst exponent using wavelet variance method
multifractal_spectrum
Compute multifractal spectrum using wavelet leaders method
scaling_exponents
Compute scaling exponents at each decomposition level
wavelet_leader_diagnostics
Compute wavelet-leader scaling diagnostics in a single call.
wavelet_leader_scaling
Compute raw wavelet-leader structure functions and scaling exponents.