timeseries.joint_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.joint_recurrence_network.JointRecurrenceNetwork(x, y, metric=('supremum', 'supremum'), normalize=False, lag=0, silence_level=0, **kwds)[source]¶
Bases:
JointRecurrencePlot
,Network
Class JointRecurrenceNetwork for generating and quantitatively analyzing joint recurrence networks.
For a joint recurrence network, time series x and y need to have the same length! Formally, nodes are identified with sampling points in time, while an undirected link (i,j) is introduced if x at time i is recurrent to x at time j and also y at time i is recurrent to y at time j. Self-loops are excluded in this undirected network representation.
More information on the theory and applications of joint recurrence networks can be found in [Feldhoff2013].
Examples:
Create an instance of JointRecurrenceNetwork with a fixed recurrence threshold and without embedding:
JointRecurrenceNetwork(x, y, threshold=(0.1,0.2))
Create an instance of JointRecurrenceNetwork with a fixed recurrence threshold in units of STD and without embedding:
JointRecurrenceNetwork(x, y, threshold_std=(0.03,0.05))
Create an instance of JointRecurrenceNetwork at a fixed recurrence rate and using time delay embedding:
JointRecurrenceNetwork( x, y, dim=(3,5), tau=(2,1), recurrence_rate=(0.05,0.04)).recurrence_rate()
- __init__(x, y, metric=('supremum', 'supremum'), normalize=False, lag=0, silence_level=0, **kwds)[source]¶
Initialize an instance of JointRecurrenceNetwork.
Note
For a joint recurrence network, time series x and y need to have the same length!
Creates an embedding of the given time series x and y, calculates a joint recurrence plot from the embedding and then creates a Network object from the joint recurrence plot, interpreting the joint recurrence matrix as the adjacency matrix of an undirected complex network.
Either recurrence thresholds
threshold
/threshold_std
or recurrence ratesrecurrence_rate
have to be given as keyword arguments.Embedding is only supported for scalar time series. If embedding dimension
dim
and delaytau
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”). Give separately for each time series.
normalize (tuple of bool) – Decide whether to normalize the time series to zero mean and unit standard deviation. Give separately for each time series.
lag (number) – To create a delayed version of the JRP.
silence_level (number) – Inverse level of verbosity of the object.
threshold (tuple of number) – The recurrence threshold keyword for generating the recurrence plot using a fixed threshold. Give separately for each time series.
threshold_std (tuple of number) – The recurrence threshold keyword for generating the recurrence plot using a fixed threshold in units of the time series’ STD. Give separately for each time series.
recurrence_rate (tuple of number) – The recurrence rate keyword for generating the recurrence plot using a fixed recurrence rate. Give separately for each time series.
dim (tuple of number) – The embedding dimension. Give separately for each time series.
tau (tuple of number) – The embedding delay. Give separately for each time series.
- set_fixed_recurrence_rate(recurrence_rate)[source]¶
Create a joint recurrence network at fixed link densities (recurrence rates).
- Parameters:
recurrence_rate (tuple of number) – The link density / recurrence rate. Give for each time series separately.