pyhctsa.operations.nonlinearity.gp_corr_sum

pyhctsa.operations.nonlinearity.gp_corr_sum(y, nref=500, r=0.05, thwin=('ac', 1), nbins=20, embed_params=('ac', 'fnn'), do_two=1)

How the number of close pairs of points in the delay embedding grows with distance (the correlation sum and its scaling).

Computes the correlation sum, \(C(\epsilon)\), the fraction of pairs of time-delay-embedded points closer than \(\epsilon\) (in the max norm, as d2 measures distances), by the Grassberger-Procaccia algorithm [1], using TISEAN’s d2. For a low-dimensional attractor, \(\ln C\) rises linearly with \(\ln \epsilon\), with a slope equal to the correlation dimension. The outputs summarize the range of \(\ln \epsilon\) and \(\ln C(\epsilon)\), and an iteratively re-weighted least squares (robust) linear fit to the log-log plot.

References

Parameters:
y : array-like

Input time series.

nref : int or float, optional

Maximum number of pairs of points counted at each length scale (TISEAN’s d2 -N, maxfound), not a number of reference points: a length scale that has this many pairs (at the largest embedding dimension) is no longer updated. -1 counts all pairs, a value in (0, 1) is a fraction of the time-series length. Default is 500.

r : float, optional

Maximum search radius, in units of std(y) * sqrt(m) where m is the embedding dimension. Default is 0.05. The factor sqrt(m) is a convention: under the max norm the share of pairs within a fixed radius falls roughly geometrically with m, and the growing radius keeps the scanned range populated with pairs.

thwin=('ac', 1)

The Theiler window of samples to exclude before and after each reference index (see pyhctsa.utils.theiler_window()): ['ac', k] for k times the first zero-crossing of the autocorrelation function, or a number of samples. Default is ['ac', 1].

nbins : int, optional

Number of (log-spaced) radii at which the correlation sum is found. Default is 20.

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'].

do_two : int, optional

Only 1 (corrsum-style log-spaced radii, the default) is supported; 2 has no TISEAN equivalent and raises ValueError, as in hctsa.

Returns:

Only radii with a finite \(\ln C(\epsilon)\) are used. minlnr, maxlnr: the smallest and largest \(\ln \epsilon\); minlnCr, maxlnCr, rangelnCr, meanlnCr: the minimum, maximum, range and mean of \(\ln C\); robfit_a1, robfit_a2: intercept and slope of a robust linear fit of \(\ln C\) against \(\ln \epsilon\); robfit_sigrat: ratio of the ordinary least-squares to the robust estimate of the residual standard deviation; robfit_s: the robust estimate of the residual standard deviation; robfit_sea1, robfit_sea2: standard errors of the intercept and slope; robfitresmeanabs, robfitresmeansq, robfitresac1: mean absolute and mean squared residual, and lag-1 autocorrelation of the residuals. The fit outputs are NaN when too few radii have a finite \(\ln C\); robfit_sigrat is NaN when the robust estimate of the residual standard deviation, and robfitresac1 when the standard deviation of the residuals, is at floating-point round-off (at most 10 * N * eps times the root-mean-square of the fitted \(\ln C\), over N radii, as in pyhctsa.robust.bf_residual_stats()), since a ratio of rounding noise carries no information. Returns NaN if the delay or Theiler window cannot be set, the embedding is too short, or no correlation sum is obtained.

Return type:

dict or float