pyhctsa.operations.entropy.rpde¶
-
pyhctsa.operations.entropy.rpde(y, m=
2, tau=1, epsilon=0.12, t_max=-1)¶ Recurrence period density entropy (RPDE).
RPDE (Little et al. 2007) measures how repetitive a signal’s dynamics are, from the distribution of the times at which the delay-embedded trajectory comes back to where it was. The series is embedded as \(v_i = (y_i, y_{i+\tau}, \ldots, y_{i+(m-1)\tau})\). Starting from each embedded point, the trajectory is followed until it has left the ball of radius
epsilon(Euclidean) around that point and then re-entered it; the number of steps taken is that point’s recurrence time. The histogram of these times, normalized to unit sum, is the recurrence period density (RPD) \(p_T\). Its Shannon entropy \(H = -\sum_T p_T \ln p_T\) is scaled by \(\ln N_b\), the largest entropy attainable with \(N_b\) bins, to giveH_normin [0, 1]. A periodic signal concentrates the RPD on a few times (H_normnear 0), while a stochastic signal spreads it widely (H_normnear 1).The series is used as given: scale it first (
epsilonis an absolute distance, so a z-scored series is intended).- Parameters:¶
- y : array-like¶
Input signal.
- m : int, optional¶
Embedding dimension. Default is 2.
- tau : int or str, optional¶
Embedding time delay: an integer, or a rule understood by
get_tau(). Default is 1.- epsilon : float, optional¶
Recurrence neighborhood radius. Default is 0.12.
- t_max : int, optional¶
Maximum recurrence time: the RPD is truncated to its first
t_maxbins (-1: no limit). Default is -1.
- Returns:¶
H(entropy of the RPD, nats),H_norm(H / ln(Nb), whereNbis the number of bins of the RPD, empty bins included),propNonZero(fraction of bins that are non-empty),meanNonZero(mean non-zero RPD value timesNb) andmaxRPD(largest RPD value timesNb). All are NaN if the embedding parameters cannot be determined, the embedding has fewer than 2 points, or no point ever returns.- Return type:¶
dict
Notes
Written from the published method: M. A. Little, P. E. McSharry, S. J. Roberts, D. A. E. Costello and I. M. Moroz, “Exploiting nonlinear recurrence and fractal scaling properties for voice disorder detection”, BioMedical Engineering OnLine 6:23 (2007). The close-returns idea goes back to G. B. Mindlin and R. Gilmore, “Topological analysis and synthesis of chaotic time series”, Physica D 58, 229 (1992). The scan is O(n^2) in the worst case and is compiled with numba.