pyhctsa.operations.graph.ordinal_partition_network

pyhctsa.operations.graph.ordinal_partition_network(y, d=3, tau=1)

Ordinal partition transition network measures.

Symbolizes the time series into ordinal patterns (Bandt-Pompe) and builds a directed transition network in which nodes are the ordinal patterns actually observed and edges connect a pattern to whichever pattern immediately follows it in time. Network-topological measures of this ordinal partition transition network are then computed. The network is unweighted: an edge exists if the transition occurs at least once (self-transitions included).

Entropy is not recomputed here, to avoid duplicating pyhctsa.operations.entropy.permutation_entropy(), which computes entropy-based measures on the same symbolization; Kulp et al. found entropy to be a weaker discriminator than the network measures computed below.

References

Parameters:
y : array-like

The input time series.

d : int, optional

The ordinal pattern (embedding) dimension: windows of d consecutive (delay-tau-spaced) points are each mapped to their rank permutation, one of d! possible ordinal patterns. Default is 3.

tau : int or str, optional

The time delay: an integer number of samples, or a rule understood by pyhctsa.utils.get_tau() ('ac', the first zero-crossing of the autocorrelation function; 'ac1e', the floor of its first 1/e crossing; or 'mi', the smaller of the first minimum of the Kraskov automutual information and the 'ac1e' delay), as in the time-lagged networks of McCullough et al. Default is 1, as used throughout Kulp et al.

Returns:

NaN if the embedding fails (e.g. the delay cannot be set) or there are fewer than 30 embedded points. Otherwise a dictionary with:

  • meanDegree: the mean degree (average number of unique out-edges per visited node, m / n for m unique edges and n nodes; equal to the mean in-degree), the paper’s central discriminating measure

  • NFP: the number of forbidden (non-occurring) ordinal patterns, d! minus the number of nodes

  • maxOutDegree, maxInDegree: the largest out-degree and in-degree

  • stdOutDegree, stdInDegree: the standard deviation of the out- and in-degrees

  • reciprocity: the fraction of unique edges whose reverse edge also exists

  • maxEdgeWeight: the proportion of all observed transitions taken up by the most frequent single transition

(The maximum and spread of the degrees, reciprocity and edge-weight measures are not reported in the paper but are cheaply available from the same transition-pair computation.)

Return type:

dict or float