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:
- mrq
MultiResolutionQuantity
Multi resolution quantity to analyze.
- q
ndarray
,shape
(n_exponents,) Exponent for which to compute the structure function
- j1
int
Lower-bound of the scale support for the linear regressions.
- j2
int
Upper-bound of the scale support for the linear regressions.
- weighted: str | None
Whether to used weighted linear regressions.
- mrq
- Attributes:
- formalism
str
Formalism used. Can be any of ‘wavelet coefs’, ‘wavelet leaders’, or ‘wavelet p-leaders’.
- nj
dict
(ndarray
) Number of coefficients at scale j. Arrays are of the shape (n_rep,)
- j
ndarray
,shape
(n_scales,) List of the j values (scales), in order presented in the value arrays.
- j1
int
Lower-bound of the scale support for the linear regressions.
- j2
int
Upper-bound of the scale support for the linear regressions.
- weighted
str
|None
Whether weighted regression was performed.
- q
ndarray
,shape
(n_exponents,) Exponents for which the structure functions have been computed
- values
ndarray
,shape
(n_exponents
,n_scales
,n_rep
) Structure functions : \(S(j, q)\)
- logvalues
ndarray
,shape
(n_exponents
,n_scales
,n_rep
) \(\log_2 S(j, q)\)
- zeta
ndarray
,shape
(n_exponents
,n_rep
) Scaling function : \(\zeta(q)\)
- H
ndarray
,shape
(n_rep,) |None
Estimates of H. Set to None if 2 is not in q.
- n_rep
int
Number of realisations
- formalism
- classmethod from_dict(d)#
Method to instanciate a dataclass by passing a dictionary with extra keywords
- Parameters:
- d
dict
Dictionary containing at least all the parameters required by __init__, but can also contain other parameters, which will be ignored
- d
- 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.