wavelet_leader_scaling

Function wavelet_leader_scaling 

Source
pub fn wavelet_leader_scaling<T>(
    signal: &Signal<T>,
    wavelet: &dyn Wavelet,
    config: MultifractalConfig,
) -> Result<WaveletLeaderScaling>
Expand description

Compute raw wavelet-leader structure functions and scaling exponents.

This is a lower-level API that exposes the intermediate quantities used by multifractal_spectrum. It follows the Wavelet Leader Multifractal (WLMF) formalism of Wendt–Abry–Jaffard:

  1. Compute cone-based wavelet leaders L(j, k) from MODWT coefficients.
  2. For each moment q and scale j, compute structure functions S(j, q) = (1 / n_j) Σ_k L(j, k)^q.
  3. Estimate scaling exponents ζ(q) from linear regressions of ln S(j, q) versus scale j.

This function does not perform the Legendre transform or any bootstrap resampling; it is intended for advanced users who want direct access to S(j, q) and ζ(q).

§Examples

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

let data: Vec<f64> = (0..512).map(|i| (i as f64 * 0.1).sin()).collect();
let signal = Signal::new(data);
let wavelet = Daubechies::new(DaubechiesType::Db4);

// Use symmetric moment range with step 1.0 so that
// q = -1, 0, 1 are present for curvature estimation.
let config = MultifractalConfig::with_moments(-2.0, 2.0, 1.0)
    .with_bootstrap_samples(0);

let scaling = wavelet_leader_scaling(&signal, &wavelet, config)?;

// Inspect scaling exponents ζ(q)
println!("moments q: {:?}", scaling.moments);
println!("ζ(q): {:?}", scaling.scaling_exponents);

// Compute a simple multifractality score from ζ''(0)
if let Some(score) = scaling.multifractality_score() {
    println!("Multifractality score (|ζ''(0)|): {:.3}", score);
}