pymultifracs.structurefunction.StructureFunction#

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

Computes and analyzes structure functions

Parameters:
mrqMultiResolutionQuantity

Multi resolution quantity to analyze.

qndarray, shape (n_exponents,)

Exponent for which to compute the structure function

j1int

Lower-bound of the scale support for the linear regressions.

j2int

Upper-bound of the scale support for the linear regressions.

weighted: str | None

Whether to used weighted linear regressions.

Attributes:
formalismstr

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

njdict(ndarray)

Number of coefficients at scale j. Arrays are of the shape (n_rep,)

jndarray, shape (n_scales,)

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

j1int

Lower-bound of the scale support for the linear regressions.

j2int

Upper-bound of the scale support for the linear regressions.

weightedstr | None

Whether weighted regression was performed.

qndarray, shape (n_exponents,)

Exponents for which the structure functions have been computed

valuesndarray, shape (n_exponents, n_scales, n_rep)

Structure functions : \(S(j, q)\)

logvaluesndarray, shape (n_exponents, n_scales, n_rep)

\(\log_2 S(j, q)\)

zetandarray, shape(n_exponents, n_rep)

Scaling function : \(\zeta(q)\)

Hndarray, shape (n_rep,) | None

Estimates of H. Set to None if 2 is not in q.

n_repint

Number of realisations

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='Structure Functions', nrow=4, filename=None, ignore_q0=True, figsize=None, scaling_range=0, plot_scales=None, plot_CI=True)#

Plots the structure functions.