Introduction

About

pyunicorn (Unified Complex Network and RecurreNce analysis toolbox) is an object-oriented Python package for the advanced analysis and modeling of complex networks. Beyond the standard measures of complex network theory (such as degree, betweenness and clustering coefficients), it provides some uncommon but interesting statistics like Newman’s random walk betweenness. pyunicorn also provides novel node-weighted (node splitting invariant) network statistics, measures for analyzing networks of interacting/interdependent networks, and special tools to model spatially embedded complex networks.

Moreover, pyunicorn allows one to easily construct networks from uni- and multivariate time series and event data (functional/climate networks and recurrence networks). This involves linear and nonlinear measures of time series analysis for constructing functional networks from multivariate data (e.g., Pearson correlation, mutual information, event synchronization and event coincidence analysis). pyunicorn also features modern techniques of nonlinear analysis of time series (or pairs thereof), such as recurrence quantification analysis (RQA), recurrence network analysis and visibility graphs.

pyunicorn is fast, because all costly computations are performed in compiled C code. It can handle large networks through the use of sparse data structures. The package can be used interactively, from any Python script, and even for parallel computations on large cluster architectures.

Example

To generate a recurrence network with 1000 nodes from a sinusoidal signal and to compute its network transitivity, you can simply run:

import numpy as np
from pyunicorn.timeseries import RecurrenceNetwork

x = np.sin(np.linspace(0, 10 * np.pi, 1000))
net = RecurrenceNetwork(x, recurrence_rate=0.05)
print(net.transitivity())