ergmx.ergm#
- ergmx.ergm(network, formula, *, constraints=None, offset_coef=None, bipartite=None, estimate='MLE', init=None, seed=None, eval_loglik=True, control=None, **control_args)[source]#
Fit an exponential-family random graph model.
- Parameters:
network (
igraph.Graph,networkx.Graph,NetworksorNetSeries) – The observed network. Vertex attributes are available to the terms. Edges with a truenaattribute mark dyads whose value is unknown: the fit is then conditional on the observed dyads (missing at random, as in ergm). Several networks combined withergmx.Networks()are modeled jointly (with N() terms), and the transitions of aergmx.NetSeries()conditionally on the network before each (with tergm’s operators; seeergmx.tergm()).formula (
strorterms) – The model, in R syntax:"edges + nodematch('Grade') + gwesp(0.5, fixed=TRUE)", or terms combined with+.constraints (
str, optional) – Sample space constraints, in R syntax:"bd(maxout=5)","degrees","blocks('level', levels2=TRUE)"… Seeergmx.constraints.offset_coef (
array-like, optional) – The fixed coefficients of theoffset()terms, in formula order;-infforbids the ties they count.bipartite (
strorbool, optional) – For a bipartite (two-mode) network, the vertex attribute giving each vertex’s mode: false or 0 for the first mode (ergm’s “b1”), true or 1 for the second.Trueuses igraph’stypeor networkx’sbipartiteattribute. Only ties between the modes are modeled.estimate (
{"MLE", "MPLE", "CD"}) –"MLE"(default) gives the exact MLE of dyad-independent models and the Monte Carlo MLE of the others."MPLE"stops at the maximum pseudo-likelihood estimate, and"CD"at the contrastive divergence estimate (as in ergm; no standard errors).init (
{"MPLE", "CD"}orarray-like, optional) – Starting coefficients for the Monte Carlo MLE: the MPLE (the default, unless the constraints are dyad-dependent), the contrastive divergence estimate (started from the MPLE; the default with dyad-dependent constraints, as in ergm), or given values.seed (
int, optional) – Seed for reproducible results.eval_loglik (
bool) – Estimate the log-likelihood of dyad-dependent models, for AIC and BIC, by path sampling (as ergm does by default). Dyad-independent models always get their exact log-likelihood.control (
Control, optional) – MCMC and estimation settings. Keyword arguments (samplesize=...,interval=...,n_chains=...) override single settings.
- Returns: