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
d2measures distances), by the Grassberger-Procaccia algorithm [1], using TISEAN’sd2. 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.-1counts 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)wheremis the embedding dimension. Default is 0.05. The factorsqrt(m)is a convention: under the max norm the share of pairs within a fixed radius falls roughly geometrically withm, 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]forktimes 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:
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'].- 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_sigratis NaN when the robust estimate of the residual standard deviation, androbfitresac1when the standard deviation of the residuals, is at floating-point round-off (at most10 * N * epstimes the root-mean-square of the fitted \(\ln C\), overNradii, as inpyhctsa.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