ergmx.simulate#

ergmx.simulate(network, formula, coef, nsim=1, *, constraints=None, bipartite=None, seed=None, output='network', burnin=None, interval=None, triadic_weight=None)[source]#

Simulate networks from an ERGM, starting from network.

Parameters:
  • network (igraph.Graph, networkx.Graph, Networks or NetSeries) – The starting network, which also provides the vertex attributes. Missing dyads (na edges) start as non-ties and are simulated too. With several networks combined, each simulation is a list of networks, one per network (for a NetSeries, each transition’s current network, given the previous one). For simulating a network over time, see ergmx.simulate_dynamic().

  • formula (str or terms)

  • coef (array-like or dict) – Coefficients, in the order of the formula’s parameters or by name, including those of offset terms (and the decays of curved terms).

  • nsim (int) – Number of networks.

  • constraints (str, optional) – Sample space constraints, as in ergm().

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

  • output ({"network", "stats"}) – Return graphs of the same kind as network (lists of them, with combined networks), or an nsim x statistics array of their statistics.

  • burnin (int, optional) – MCMC proposals before the first network and between networks. Default to ergm’s 16384 and 1024.

  • interval (int, optional) – MCMC proposals before the first network and between networks. Default to ergm’s 16384 and 1024.

  • triadic_weight (float, optional) – Share of MCMC proposals that close or open a triangle. Defaults to 0.5 for models with triangle or shared partner terms, 0 otherwise.