ergmx.tergm#
- ergmx.tergm(networks, formula, *, estimate='CMLE', times=None, constraints=None, offset_coef=None, bipartite=None, init=None, seed=None, eval_loglik=True, control=None, targets=None, target_stats=None, egmme=None, na_impute=None, **control_args)[source]#
Fit a temporal ERGM to a series of networks by conditional maximum likelihood, as R’s
tergm(..., estimate="CMLE").Each transition, from one network of the series to the next, is modeled conditionally on the network before it, with tergm’s operators:
Form(~terms)models the ties that form (its terms are those of the union of the previous and the current network),Persist(~terms)those that persist (the intersection;Diss()is the same with the signs of the coefficients reversed),Cross(~terms)the current network andChange(~terms)the dyads that changed. A model with only Form() and Persist() (or Diss()) is separable (a STERGM): formation and persistence are independent given the previous network. Every transition has the same coefficients, unless their linear models (lm=) make them depend on the time (seeergmx.NetSeries()).- Parameters:
networks (
listofigraph.Graphornetworkx.Graph, orNetSeries) – The networks, in time order, on the same vertices.formula (
strorterms) – For example"Form(~edges + mutual + gwesp(0.5, fixed=TRUE)) + Persist(~edges + mutual)".estimate (
{"CMLE", "CMPLE", "EGMME"}) – The conditional MLE (Monte Carlo, or exact for dyad-independent models), the conditional maximum pseudo-likelihood estimate, or tergm’s equilibrium generalized method of moments estimate (EGMME), which fits the process to a single network and the durations of its ties: the coefficients whose process has, at equilibrium, thetarget_statsof the statistics oftargets.targets (
strorterms) – For the EGMME, a formula of the statistics to match: ergm terms, and statistics of tie ages (mean.age,edge.ages,edges.ageinterval,edgecov.ages,nodefactor.mean.age).target_stats (
array-like, optional) – Their values: by default, the network’s (necessary for the ages).egmme (
dict, optional) – Settings of the EGMME’s stochastic approximation (seeergmx._temporal._EGMME_DEFAULTS): its burn-in, gradient runs, gain, subphases and iterations, and the length of each time step’s chain (min_steps…).times (
listofnumbers, optional) – The times the networks were observed (0, 1, 2… by default), for.Timeand.TimeDeltain linear models.na_impute (
strorlistofstr, optional) – How to impute the missing dyads of the networks transitioned from, as tergm’sCMLE.NA.impute: seeergmx.NetSeries().constraints – As in
ergmx.ergm().offset_coef – As in
ergmx.ergm().bipartite – As in
ergmx.ergm().init – As in
ergmx.ergm().seed – As in
ergmx.ergm().eval_loglik – As in
ergmx.ergm().control – As in
ergmx.ergm().
- Returns:
ErgmFit– Itssimulate()continues the series withtime_slices=.