API reference

andrey.SummaryGraph#

class andrey.SummaryGraph[source]#

The lags of a TemporalStructure merged into one directed graph over the variables.

Get one from TemporalStructure.summary_graph(). It is a GraphStructure with kind="digraph": i -> j means X_i affects X_j at one or more lags, so i -> j at one lag and j -> i at another form a 2-cycle, and a variable’s effect on its own future is a self-loop. lags_of(i, j) and edge_lags give the lags behind each edge. Every GraphStructure view applies. from_numpy, from_edges, from_networkx, and from_pcalg raise TypeError, because a plain graph carries no lags; build a plain graph with GraphStructure’s. StructureOutput.save raises TypeError for a SummaryGraph; save the TemporalStructure and call summary_graph() again after loading.

property edge_lags: tuple[tuple[int, int, tuple[int, ...]], ...]#

Every edge with its lags, as (i, j, lags) triples sorted by (i, j).

lags_of(i, j)[source]#

Return the sorted lag values at which the directed edge i -> j appears.

Parameters:
  • i (int) – Source node index of the directed edge.

  • j (int) – Target node index of the directed edge.

Returns:

The sorted lag values at which i -> j appears; () if the edge is absent.

Return type:

tuple[int, ...]