ergmx.Networks#

ergmx.Networks(*networks, bipartite=None)[source]#

Several networks to model jointly, as R’s ergm.multi::Networks().

The networks keep their vertex attributes; inside N(), each network’s terms are evaluated on that network, and the operator’s linear model can use network-level attributes (igraph’s graph attributes or networkx’s G.graph), the network size n, .NetworkID (1, 2, …) and .NetworkName. Terms outside N() are evaluated on the networks combined, as in ergm.multi.

Parameters:
  • *networks (igraph.Graph or networkx.Graph) – The networks, as arguments, a list, or a dict whose keys name them. They must be all directed or all undirected, and can differ in size.

  • bipartite (str or bool, optional) – For bipartite networks, the vertex attribute with each vertex’s mode, as in ergmx.ergm().

Examples

>>> from ergmx import datasets
>>> monks = ergmx.Networks(datasets.load("samplk1"), datasets.load("samplk2"))
>>> ergmx.ergm(monks, "N(~edges + mutual)")