pymultifracs.mfspectrum.MultifractalSpectrum#

class pymultifracs.mfspectrum.MultifractalSpectrum(mrq: dataclasses.InitVar[MultiResolutionQuantity], scaling_ranges: List[Tuple[int]], q: array, bootstrapped_mfa: dataclasses.InitVar[MFractalVar] = None, weighted: str = None)#

Estimates the Multifractal Spectrum

Based on equations 2.74 - 2.78 of Herwig Wendt’s thesis [1]

Parameters:
mrqMultiResolutionQuantity

Multi resolution quantity to analyze.

scaling_ranges: List[Tuple[int]]

List of pairs of (j1, j2) ranges of scales for the analysis

qndarray, shape (n_exponents,)

Exponents used construct the multifractal spectrum

boostrapped_mfa: MFractalVar | None

Output of the MFA of bootstrapped MRQs.

weightedstr | None

Whether to used weighted linear regressions.

References

[1]

H. Wendt (2008). Contributions of Wavelet Leaders and Bootstrap to Multifractal Analysis: Images, Estimation Performance, Dependence Structure and Vanishing Moments. Confidence Intervals and Hypothesis Tests. Ph.D thesis, Laboratoire de Physique, Ecole Normale Superieure de Lyon. https://www.irit.fr/~Herwig.Wendt/data/ThesisWendt.pdf

Attributes:
formalismstr

Formalism used. Can be any of ‘wavelet coefs’, ‘wavelet leaders’, or ‘wavelet p-leaders’.

jndarray, shape (n_scales,)

List of the j values (scales), in order presented in the value arrays.

scaling_ranges: List[Tuple[int]]

List of pairs of (j1, j2) ranges of scales for the analysis

weightedstr | None

If not None, indicates the weighting approach used for regression

qndarray, shape(n_exponents,)

Exponents used construct the multifractal spectrum

Dqndarray, shape (n_exponents, n_rep)

Fractal dimensions : \(D(q)\), y-axis of the multifractal spectrum

hqndarray, shape (n_exponents, n_rep)

Hölder exponents : \(h(q)\), x-axis of the multifractal spectrum

Undarray, shape (n_scales, n_exponents, n_rep)

\(U(j, q)\)

Vndarray, shape (n_scales, n_exponents, n_rep)

\(V(j, q)\)

classmethod from_dict(d)#

Method to instanciate a dataclass by passing a dictionary with extra keywords

Parameters:
ddict

Dictionary containing at least all the parameters required by __init__, but can also contain other parameters, which will be ignored

Returns:
MultiResolutionQuantityBase

Properly initialized multi resolution quantity

Notes

Note

Normally, dataclasses can only be instantiated by only specifiying parameters expected by the automatically generated __init__ method. Using this method instead allows us to discard extraneous parameters, similarly to introducing a **kwargs parameter.

get_nj()#

Returns nj as a list

get_nj_interv(j1, j2)#

Returns nj as an array, for j in [j1,j2]

plot(figlabel='Multifractal Spectrum', filename=None, ax=None, fmt='ko-', scaling_range=0, signal_idx=0, **plot_kwargs)#

Plot the multifractal spectrum.

Parameters:
figlabelstr

Figure title

filenamestr | None

If not None, path used to save the figure