timeseries.visibility_graph

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.visibility_graph.VisibilityGraph(time_series, timings=None, missing_values=False, horizontal=False, silence_level=0)[source]

Bases: InteractingNetworks

Class VisibilityGraph for generating and analyzing visibility graphs of time series.

Visibility graphs were initially applied for time series analysis by [Lacasa2008].

__init__(time_series, timings=None, missing_values=False, horizontal=False, silence_level=0)[source]

Missing values are handled as infinite values, effectively separating the visibility graph into different disconnected components.

Note

Missing values have to be marked by the Numpy NaN flag!

Parameters:
  • time_series (1D array) – The (scalar) time series to be analyzed.

  • timings (str) – Timings of the observations in time_series.

  • missing_values (bool) – Toggle special treatment of missing values in time_series.

  • horizontal (bool) – Indicates whether a horizontal visibility relation is used.

  • silence_level (number) – Inverse level of verbosity of the object.

__str__()[source]

Returns a string representation.

advanced_betweenness()[source]

Return betweenness of a node with respect to all pairs of nodes in its future.

advanced_closeness()[source]

Return average path length to nodes in the future of a node.

advanced_degree()[source]

Return number of neighbors in the future of a node.

advanced_local_clustering()[source]

Return probability that two neighbors of a node in its future are connected.

boundary_corrected_closeness()[source]

Return a weighted closeness corrected for trivial boundary effects.

boundary_corrected_degree()[source]

Return a weighted degree corrected for trivial boundary effects.

missing_values

Controls special treatment of missing values in time_series.

retarded_betweenness()[source]

Return betweenness of a node with respect to all pairs of nodes in its past.

retarded_closeness()[source]

Return average path length to nodes in the past of a node.

retarded_degree()[source]

Return number of neighbors in the past of a node.

retarded_local_clustering()[source]

Return probability that two neighbors of a node in its past are connected.

silence_level: int

The inverse level of verbosity of the object.

time_series

The time series from which the visibility graph is constructed.

timings

The timimgs of the time series data points.

trans_betweenness()[source]

Return betweenness of a node with respect to all pairs of nodes with one node the past and one node in the future, respectively.

visibility(node1, node2)[source]

Returns the visibility between node 1 and 2 as boolean. :arg int node1: node index of node 1 :arg int node2: node index of node 2 :rtype: bool

visibility_relations()[source]

Returns visibility between all nodes of self.timeseries :rtype: 2D array of MASK

visibility_relations_horizontal()[source]

Returns horizontal visibility between all nodes of self.timeseries :rtype: 2D array of MASK

visibility_single(node)[source]

Returns the visibility between all nodes of self.time_series and node as array of booleans. :arg int node: node index of the node :rtype: 1D array of bool