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 and its associated variance estimator is unbiased and accounts for boundary-affected coefficients at each level – the standard approach for a scale-wise variance decomposition (Percival & Walden).

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 (can be set to ‘max’ for the maximum level supported by the series length, floor(log2(N))). Default is 5.

Returns:

Dictionary containing:

  • ’scalingFrac’: the fraction of 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(variance) vs. level across the detail bands – a wavelet-based scaling exponent, analogous to a Hurst estimate but using the MODWT’s unbiased, boundary-corrected variance rather than an ad hoc regression on raw coefficients.

Return type:

dict