pyhctsa.operations.nonlinearity.box_count_entropy_rate

pyhctsa.operations.nonlinearity.box_count_entropy_rate(y, num_bins=100, embed_params=('ac', 'fnn'))

How the box-counting (order-2 Renyi) entropy of a delay embedding grows with embedding dimension.

Time-delay embeds the series in d = 1, ..., m dimensions and partitions the space into boxes of side epsilon, using TISEAN’s boxcount. With p_i the fraction of embedded points in box i, boxcount gives the order-2 Renyi (collision) entropy H(epsilon, d) = -log(sum_i p_i^2) for a sweep of num_bins box sizes, from the full range of the series downward, and the increment over the (d-1)-dimensional embedding, I(epsilon, d) = H(epsilon, d) - H(epsilon, d-1) (defined for d = 2, ..., m; at d = 1, boxcount reports H itself, which is not an increment, so d = 1 is excluded from all summaries). The matrix I (length scales by embedding dimensions 2, ..., m) is summarized across length scales for each dimension, across dimensions for each length scale, and overall.

The increment I approaches the entropy rate of the process (the K2 entropy, per delay step) rather than a slope against log(epsilon), so these features are entropy-rate-like, not correlation dimensions (despite hctsa’s former name for this operation, NL_BoxCorrDim). hctsa registers meanr, medianr, minr and meanchr at r = 2, 3, 4, 6, 8, 11, 14, 17, 20, 24, 28, 32, 36 of num_bins = 50 (2 to 429 boxes per axis). Testing indicated that coarse scales change quickly with r (so they are sampled densely), that neighboring finer scales are nearly redundant, that for flows (long delays) the informative scales lie beyond r = 18, and that beyond r = 36 the 5-dimensional embedding saturates (I = 0) for series of a few thousand points.

Parameters:
y : array-like

The input time series.

num_bins : int, optional

The number of length-scale (epsilon) values in the box-counting sweep (at least 2). TSTOOL’s “maximum number of partitions per axis” has no exact TISEAN equivalent; this is the closest analogue. Default is 100.

embed_params : list or tuple, optional

The embedding parameters as (tau, m): the time delay (an integer, or a rule understood by pyhctsa.utils.get_tau(): 'ac', 'ac1e' or 'mi') and the embedding dimension (an integer, or 'fnn' for false nearest neighbors). hctsa uses ('ac1e', 5). Default is ('ac', 'fnn').

Returns:

NaN if the embedding parameters cannot be determined, the series is constant, or the embedding dimension is below 2. Otherwise summaries of I(epsilon, d), with d the embedding dimension and r the index (from 1) of the length scale (r = 1 is the full range of the series, larger r are finer scales):

  • meand<d>, mediand<d>: mean and median of I over length scales, at embedding dimension d = 2, ..., m

  • meanr<r>, medianr<r>, minr<r>: mean, median and minimum of I over embedding dimensions 2, ..., m, at length scale r = 2, ..., num_bins

  • meanchr<r>: mean change of I from one embedding dimension to the next (d = 2, ..., m), at length scale r = 2, ..., num_bins (NaN for m = 2)

  • stdmean, stdmedian: standard deviation, across embedding dimensions 2, ..., m, of the mean (or median) of I over length scales

  • medianstretch, iqrstretch: median and interquartile range of I over all length scales and embedding dimensions 2, ..., m

(The minima over all length scales are not returned: the coarsest scale is a single box, where I = 0, so they are always 0.)

Return type:

dict or float