pyhctsa.operations.wavelet.modwt_var

pyhctsa.operations.wavelet.modwt_var(y, w_name='db3', level=5)

Multiscale variance decomposition via the maximal overlap DWT.

Decomposes the time series into octave-scale bands using the maximal overlap discrete wavelet transform (MODWT) and computes summary statistics on how variance is distributed across scales. Unlike the standard (decimated) DWT used elsewhere in this codebase, the MODWT is shift-invariant. With its periodic boundary it splits the energy of the (mean-removed) series exactly across the bands (Percival & Walden, 2000, DOI 10.1017/CBO9780511841040, ch. 5), and the statistics use these energy shares, computed from all N coefficients of each band.

(Up to pyhctsa 2.0, as in hctsa, the band variances used only the coefficients unaffected by the boundary. At the scaling band that leaves N - (2^J - 1)(L - 1) strongly overlapping coefficients (N - 155 for db3 at level 5), so scalingFrac was biased towards 0 for N up to about 300, exactly 0 at some lengths, and jumped where the level had to be reduced. The energy shares agree with the old values on long series.)

Parameters:
y : array-like

The input time series.

w_name : str, optional

The mother wavelet, e.g., 'db3', 'sym2'. Default is 'db3'.

level : int or 'max', optional

The level of wavelet decomposition; ‘max’ (or a level that is too large) gives the largest level the periodic MODWT supports, floor(log2(N)). Default is 5.

Returns:

Dictionary containing:

  • ’scalingFrac’: the fraction of the variance in the lowest-frequency (scaling/trend) band – the part of the signal not resolved by any detail level.

  • ’domlevel’: the level (1 = highest frequency, …, level+1 = scaling/trend band) that carries the most variance.

  • ’decaySlope’: the slope of log2(band variance) vs. level across the detail bands – a wavelet-based scaling exponent, analogous to a Hurst estimate.

Return type:

dict