pyhctsa.operations.nonlinearity.dimensions

pyhctsa.operations.nonlinearity.dimensions(y, num_bins=50, embed_params=('ac', 'fnn'), thwin=('ac', 1))

Box-counting and correlation-sum estimates of the dimension of the delay embedding, and how they change with the embedding dimension.

Uses TISEAN’s boxcount (the Renyi entropy of order 0, \(\ln N(\epsilon)\), the log of the number of occupied boxes of a partition of the delay embedding) and d2 (the correlation sum \(\ln C(\epsilon)\)) over num_bins geometrically spaced length scales and embedding dimensions 1 to max(m, 3) (m the embedding dimension of embed_params), to summarize the curves’ means, minima, ranges and straight-line fits at m = 1, 2, 3 and the largest m, their changes with m, the scaling range in \(\ln \epsilon\) (the range of scales, in the first and second halves of the scales, minimizing the mean absolute error of a linear fit less 0.02 per point spanned) for m = 1, 2, 3 and the embedding dimension m, and the embedding dimension with the best scaling fit. Unlike hctsa, which shells out to installed TISEAN binaries, this runs the vendored d2 and an in-process port of boxcount.

Parameters:
y : array-like

Input time series.

num_bins : int, optional

Number of length scales (bins per axis) at which to evaluate the box counts and correlation sums. Default is 50.

embed_params : [tau, m], optional

Embedding parameters: tau is an integer or a rule understood by pyhctsa.utils.get_tau() ('ac', 'ac1e', 'mi'), m an integer, or 'fnn' (or ['fnn', threshold]) for the dimension from TISEAN’s false nearest neighbors (fnn(); threshold 0.05 by default; at most floor(2 log10 N), see _embedding_params()). Default is ['ac', 'fnn'].

thwin=('ac', 1)

Theiler window of the correlation sum: pairs of embedded points at most thwin samples apart (|i - j| <= thwin) are not counted, since they are close only because successive values are correlated (Theiler, Phys. Rev. A 34, 2427, 1986). A number of samples, or ['ac', k] for k times the first zero crossing of the autocorrelation function (see pyhctsa.utils.theiler_window()); NaN is returned if the ACF never crosses zero. Does not affect the box-counting (bc) outputs. Default is ['ac', 1]; use 0 for the old behavior.

Returns:

With prefix bc (box counting, \(\ln N\)) and co (correlation sum, \(\ln C\)): <p>_meanm1/2/3/max, <p>_minm1/2/3/max, <p>_range1/2/3/max, <p>_mindiff, <p>_meandiff, <p>_lfitm1/2/3/max (slope), <p>_lfitb... (intercept), <p>_lfitmeansqdev...; scr_<p>_m1/m2/m3/mopt_*: scaling range (logrmin, logrmax, logrrange, pgone) and fit (meanabsres, meansqres, scaling_exp, scaling_int, minbad); <p>_minscalingexp, <p>_meanscalingexp, <p>_maxscalingexp, <p>_mbestfit. Returns NaN if the delay cannot be set, any ln N or ln C is not finite (e.g. some correlation sum is zero), or the series is constant or too short.

Return type:

dict or float