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) andd2(the correlation sum \(\ln C(\epsilon)\)) overnum_binsgeometrically spaced length scales and embedding dimensions 1 tomax(m, 3)(mthe embedding dimension ofembed_params), to summarize the curves’ means, minima, ranges and straight-line fits atm= 1, 2, 3 and the largestm, their changes withm, 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) form= 1, 2, 3 and the embedding dimensionm, and the embedding dimension with the best scaling fit. Unlike hctsa, which shells out to installed TISEAN binaries, this runs the vendoredd2and an in-process port ofboxcount.- 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:
tauis an integer or a rule understood bypyhctsa.utils.get_tau()('ac','ac1e','mi'),man integer, or'fnn'(or['fnn', threshold]) for the dimension from TISEAN’s false nearest neighbors (fnn(); threshold 0.05 by default; at mostfloor(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
thwinsamples 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]forktimes the first zero crossing of the autocorrelation function (seepyhctsa.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\)) andco(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