ergmx.simulate_dynamic#
- ergmx.simulate_dynamic(network, formula, coef, time_slices=1, *, nsim=1, constraints=None, bipartite=None, seed=None, monitor=None, triadic_weight=None, min_steps=1000, max_steps=100000, pval=0.5, add=1.0)[source]#
Simulate a network forward in time from a temporal ERGM, as R’s tergm does with
simulate(..., dynamic=TRUE).At each of
time_slicestime steps, the next network is drawn from the model conditional on the current one: the model of each transition ofergmx.tergm(), with Form(), Persist(), Diss(), Cross() and Change() (terms outside them describe the current network, as Cross()). Each time step’s Markov chain starts from the current network and runs, as in tergm, until the number of dyads that differ from it stops growing: after at leastmin_stepsproposals, once a z-test no longer finds the (exponentially weighted) average change in that number positive, with p-value abovepval, the chain runsaddtimes as many proposals again; at mostmax_stepsin all.- Parameters:
network (
igraph.Graphornetworkx.Graph) – The network at time 0.formula (
strorterms) – A model with tergm’s operators, for example"Form(~edges + gwesp(0.5, fixed=TRUE)) + Persist(~edges)".coef (
array-likeordict) – Coefficients, in the order of the formula’s parameters or by name ("Form(1)~edges"…), asergmx.tergm()estimates them.time_slices (
int) – Number of time steps.nsim (
int) – Number of independent simulations, run in parallel.monitor (
strorterms, optional) – A formula whose statistics are computed on each network, such as"edges + mutual", and of the ages of its ties (mean.age…; the ties of the starting network count as formed at time 0).constraints – As in
ergmx.simulate().bipartite – As in
ergmx.simulate().seed – As in
ergmx.simulate().triadic_weight – As in
ergmx.simulate().min_steps – The length of each time step’s chain, as tergm’s MCMC.burnin.min, MCMC.burnin.max, MCMC.burnin.pval and MCMC.burnin.add. Set
min_stepsandmax_stepsequal for a fixed number.max_steps – The length of each time step’s chain, as tergm’s MCMC.burnin.min, MCMC.burnin.max, MCMC.burnin.pval and MCMC.burnin.add. Set
min_stepsandmax_stepsequal for a fixed number.pval – The length of each time step’s chain, as tergm’s MCMC.burnin.min, MCMC.burnin.max, MCMC.burnin.pval and MCMC.burnin.add. Set
min_stepsandmax_stepsequal for a fixed number.add – The length of each time step’s chain, as tergm’s MCMC.burnin.min, MCMC.burnin.max, MCMC.burnin.pval and MCMC.burnin.add. Set
min_stepsandmax_stepsequal for a fixed number.
- Returns:
DynamicSimulation, ora listofnsimofthem