pyhctsa.operations.nonlinearity.tisean_c1

pyhctsa.operations.nonlinearity.tisean_c1(y, tau=1, mmm=(2, 10), tsep=0.02, nref=0.5)

Information dimension by the fixed-mass method (TISEAN’s c1).

For a range of embedding dimensions, c1 finds the distance to the k-th nearest neighbor (k increasing with the fraction of the points, the “mass”, included) of a set of reference points, and the information dimension is the slope of the log mass against the log of the mean log distance (c2d averages the local slope over five points). hctsa looks for a scaling range in each dimension and summarizes the dimension estimates across them.

The routine is a port of TISEAN 3.0.1’s Fortran (c1.f, d1.f, c2d.f) in single precision, with the corrections of hctsa’s copy of TISEAN, and reproduces that binary’s output, with hctsa’s choice of reference points: the first of a fixed golden-ratio lattice ordering of the embedded points, spread evenly over the series (stock TISEAN takes the first entries of a random permutation, so the estimates depend on the draw). The stock code also uses stale memory when more reference points are requested than there are embedded points, and never finishes when it asks for more neighbors than exist (for example when the number of embedded points is a power of two); those cases are fixed here. The stock code also divides the sum of the log distances by nref - (m - 1) * tau instead of the number of reference points used, which biases the dimension estimates low; the mean is taken over the reference points used. A reference point that coincides with its k-th neighbor (to within 1e-12 of the range of the data; the routine works in single precision, so in practice to single precision) is a repeated point: at least that mass of the points sits on it, and its log distance is minus infinity. The mean log distance at that mass is then not finite, so the mass is skipped (with no masses left, there is no scaling range and the output is NaN, as for a periodic orbit).

Parameters:
y : array-like

Input time series.

tau : int or str, optional

The time delay: an integer or a rule understood by pyhctsa.utils.get_tau() ('ac', 'ac1e', 'mi'). Default is 1.

mmm : [m_min, m_max], optional

The minimum and maximum embedding dimension. Default is [2, 10].

tsep : int or float, optional

The minimum time separation of neighbors (the Theiler window), in samples, or a proportion of the series length if between 0 and 1 (exclusive). Default is 0.02.

nref : int or float, optional

The number of reference points: a number of samples, or a proportion of the series length if at most 1. At most 1000 (for time) and, if the series is longer than 500 points, at least 500 (fewer make the best-scaling-range outputs depend on which points are the reference points). Default is 0.5.

Returns:

Properties of the dimension estimates of the scaling ranges: bestestd and bestestdstd (the mean and standard deviation of the dimension over the scaling range with the best score), bestgoodness (that score), mediand, mind, maxd, ranged (across embedding dimensions), maxmd (at the largest embedding dimension), meanstd (the mean of the standard deviations), bestscrd and longestscr (the dimension at, and log-length of, the longest scaling range). NaN if the series has fewer than 100 points or is constant, the delay cannot be set, or no scaling range is found (for instance when the Theiler window leaves no neighbors).

Return type:

dict