Cumulants#

class pymultifracs.scalingfunction.Cumulants#

Bases: ScalingFunction

Computes and analyzes cumulant.

Note

Should not be instanciated but instead obtained from calling pymultifracs.mfa()

Attributes:
jndarray of int, shape (n_j,)

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

njndarray of int, shape (n_j,)

Dictionnary giving the number of non-NaN values at every scale. Arrays are of the shape (n_rep,).

gamintfloat

Value of gamint used in the computation of the underlying MRQ.

formalismstr

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

n_channelint

Number of underlying signals in the wavelet decomposition. May not match the dimensionality of the values arrays (n_rep) in case there are multiple repetitions associated to a single signal, for instance in bootstrapping.

n_cumulint

Maximum order of the computed cumulants.

mndarray of int, shape (n_cumul,)

Cumulant order values \(m\), in the order used internally.

valuesndarray of float, shape (n_cumulants, n_scales, n_rep)

\(C_m(j)\).

scaling_rangesList[(int, int)]

List of pairs of scales delimiting the temporal scale support over which the estimates are regressed.

log_cumulantsndarray, shape (n_cumulants, n_rep)

\((c_m)_m\), slopes of the curves \(j \times C_m(j)\).

var_log_cumulantsndarray, shape (n_cumulants, n_rep)

Estimates of the variance of log-cumulants.

weightedstr | None

Weighting mode for the linear regressions. Defaults to None, which means no weighting. Possible values are 'Nj' which weighs by number of coefficients, and ‘bootstrap’ which weights by bootstrap-derived estimates of variance.

weightsndarray of float, shape () #TODO: plot shape of weights here

Weights of the linear regression.

bootstrapped_objCumulants | None

Storing the bootstrapped version of the structure function if bootstraping has been used.

compute_Lambda()#

Computes \(\Lambda\) for bootstrap-based automated range selection. [1]

References

compute_R()#

Computes \(R\) for bootstrap-based automated range selection.

compute_R2()#

Computes \(R^2\) for the estimated linear regressions.

compute_RMSE()#

Computes root mean square error for the estimated linear regressions.

find_best_range(per_moment=False)#

Find the best range among those computed, given bootstrap was already performed

Parameters:
per_momentbool

If True, returns the best range for each moment. Otherwise, by default returns the overall best range for all moments.

References

get_jrange(j1=None, j2=None, bootstrap=False)#

Sanitize the scaling range \([j_1, j_2]\) and find the associated indices in the mrq.j array.

get_n_bootstrap()#

Returns the number of bootstrapping repetition, or 0 if no bootstrapping

get_nj_interv(j_min, j_max)#

Returns the number of coefficients on an interval of temporal scales.

plot(figsize=None, nrow=3, j1=None, filename=None, range_idx=0, n_cumul=None, signal_idx=0, **kwargs)#

Plots the \(C_m(j)\) and their associated \(c_m\) fits.

Parameters:
figsize: (int, int) | None

If not None, indicates the size of the figure.

nrowint

Number of rows of the figure.

j1int

Constrains the plot to scales \(j \geq j_1\).

filenamestr | None

If not None, saves the figure to filename.

signal_idxint

If using a multivariate signal, index of the signal to plot.

range_idxint

If multiple scaling ranges were used in fitting, indicates the index to use.

**kwargsdict

Optional arguments sent to pymultifracs.viz.plot_cumulants().