timeseries.inter_system_recurrence_network

Provides classes for the analysis of dynamical systems and time series based on recurrence plots, including measures of recurrence quantification analysis (RQA) and recurrence network analysis.

class pyunicorn.timeseries.inter_system_recurrence_network.InterSystemRecurrenceNetwork(x, y, metric='supremum', normalize=False, silence_level=0, **kwds)[source]

Bases: InteractingNetworks

Generating and quantitatively analyzing inter-system recurrence networks.

For a inter-system recurrence network, time series x and y do not need to have the same length! Formally, nodes are identified with state vectors in the common phase space of both time series. Hence, the time series need to have the same number of dimensions and identical physical units. Undirected links are added to describe recurrences within x and y as well as cross-recurrences between x and y. Self-loops are excluded in this undirected network representation.

More information on the theory and applications of inter system recurrence networks can be found in [Feldhoff2012].

Examples:

  • Create an instance of InterSystemRecurrenceNetwork with fixed recurrence thresholds and without embedding:

    InterSystemRecurrenceNetwork(x, y, threshold=(0.1, 0.2, 0.1))
    
  • Create an instance of InterSystemRecurrenceNetwork at a fixed recurrence rate and using time delay embedding:

    InterSystemRecurrenceNetwork(
        x, y, dim=3, tau=(2, 1), recurrence_rate=(0.05, 0.05, 0.02))
    
N: int

Total number of nodes of ISRN.

N_x

Number of nodes in subnetwork x.

N_y

Number of nodes in subnetwork y.

__cache_state__() Tuple[Hashable, ...][source]

Hashable tuple of mutable object attributes, which will determine the instance identity for ALL cached method lookups in this class, in addition to the built-in object id(). Returning an empty tuple amounts to declaring the object immutable in general. Mutable dependencies that are specific to a method should instead be declared via @Cached.method(attrs=(…)).

NOTE: A subclass is responsible for the consistency and cost of this state descriptor. For example, hashing a large array attribute may be circumvented by declaring it as a property, with a custom setter method that increments a dedicated mutation counter.

__init__(x, y, metric='supremum', normalize=False, silence_level=0, **kwds)[source]

Initialize an instance of InterSystemRecurrenceNetwork (ISRN).

Note

For an inter system recurrence network, time series x and y need to have the same number of dimensions!

Creates an embedding of the given time series x and y, calculates a inter system recurrence matrix from the embedding and then creates an InteractingNetwork object from this matrix, interpreting the inter system recurrence matrix as the adjacency matrix of an undirected complex network.

Either recurrence thresholds threshold or recurrence rates recurrence_rate have to be given as keyword arguments.

Embedding is only supported for scalar time series. If embedding dimension dim and delay tau are both given as keyword arguments, embedding is applied. Multidimensional time series are processed as is by default.

Parameters:
  • x (2D Numpy array (time, dimension)) – The time series x to be analyzed, can be scalar or multi-dimensional.

  • y (2D Numpy array (time, dimension)) – The time series y to be analyzed, can be scalar or multi-dimensional.

  • metric (tuple of string) – The metric for measuring distances in phase space (“manhattan”, “euclidean”, “supremum”).

  • normalize (bool) – Decide whether to normalize the time series to zero mean and unit standard deviation.

  • silence_level (int) – The inverse level of verbosity of the object.

  • kwds – Additional options.

  • threshold (tuple of number (three numbers)) – The recurrence threshold keyword for generating the recurrence plot using fixed thresholds. Give for each time series and the cross recurrence plot separately.

  • recurrence_rate (tuple of number (three numbers)) – The recurrence rate keyword for generating the recurrence plot using a fixed recurrence rate. Give separately for each time series.

  • dim (int) – The embedding dimension. Must be the same for both time series.

  • tau (tuple of int) – The embedding delay. Give separately for each time series.

__str__()[source]

Returns a string representation.

cross_global_clustering_xy()[source]

Return cross global clustering of x with respect to y.

See [Feldhoff2012] for definition, further explanation and applications.

Return type:

number (float)

Returns:

the cross global clustering of x with respect to y.

cross_global_clustering_yx()[source]

Return cross global clustering of y with respect to x.

See [Feldhoff2012] for definition, further explanation and applications.

Return type:

number (float)

Returns:

the cross global clustering of y with respect to x.

cross_recurrence_rate()[source]

Return cross recurrence rate between subnetworks x and y.

Return type:

number (float)

Returns:

the cross recurrence rate between subnetworks x and y.

cross_transitivity_xy()[source]

Return cross transitivity of x with respect to y.

See [Feldhoff2012] for definition, further explanation and applications.

Return type:

number (float)

Returns:

the cross transitivity of x with respect to y.

cross_transitivity_yx()[source]

Return cross transitivity of y with respect to x.

See [Feldhoff2012] for definition, further explanation and applications.

Return type:

number (float)

Returns:

the cross transitivity of y with respect to x.

inter_system_recurrence_matrix()[source]

Return the current inter system recurrence matrix \(ISRM\).

Return type:

2D square Numpy array

Returns:

the current inter system recurrence matrix \(ISRM\).

internal_recurrence_rates()[source]

Return internal recurrence rates of subnetworks x and y.

Return type:

tuple of number (float)

Returns:

the internal recurrence rates of subnetworks x and y.

metric

The metric used for measuring distances in phase space.

set_fixed_recurrence_rate(density)[source]

Create a inter system recurrence network at fixed link densities ( recurrence rates).

Parameters:

density (tuple of number (three numbers)) – The three recurrence rate parameters. Give for each time series and the cross recurrence plot separately.

set_fixed_threshold(threshold)[source]

Create a inter system recurrence network at fixed thresholds.

Parameters:

threshold (tuple of number (three numbers)) – The three threshold parameters. Give for each time series and the cross recurrence plot separately.

silence_level: int

The inverse level of verbosity of the object.

x

The time series x.

x_embedded

The embedded time series x.

y

The time series y.

y_embedded

The embedded time series y.