Description MH proposal methods implemented in the ergm package References See Also

`ergm`

uses a Metropolis-Hastings (MH) algorithm to control the behavior of the Markov Chain Monte Carlo (MCMC) for sampling networks. The MCMC chain is intended to step around the sample space of possible networks, selecting a network at regular intervals to evaluate the statistics in the model. For each MCMC step, *n* (*n=1* in the simple case) toggles are proposed to change the dyad(s) to the opposite value. The probability of accepting the proposed change is determined by the MH acceptance ratio. The role of the different MH methods implemented in `ergm`

is to vary how the sets of dyads are selected for toggle proposals. This is used in some cases to improve the performance (speed and mixing) of the algorithm, and in other cases to constrain the sample space.

`ergm`

package**MH proposals for non-constrained ergm models**

- InitErgmProposal.randomtoggle
Propose a randomly selected dyad to toggle.

- InitErgmProposal.TNT
Default MH algorithm. Stratifies the population of dyads by edge status: those having ties and those having no ties (hence T/NT). This is useful for improving performance in sparse networks, because it gives at least 50% chance of proposing a toggle of an existing edge.

**MH proposals for constrained ergm models**

- InitErgmProposal.CondB1Degree
MHp for

*constraints= ~b1degrees*. For bipartite networks, randomly select an edge B1i, B2j and an empty dyad with the same node B1i, B1i, B2k, and propose to toggle both B1i, B2j and B1i, B2k. This ensures that the degrees of individual nodes in mode 1 are preserved.- InitErgmProposal.CondB2Degree
MHp for

*constraints= ~b2degrees*. For bipartite network, randomly select an edge B1j, B2i and an empty dyad with the same node B2i, B1k, B2i, and propose to toggle both B1j, B2i and B1k, B2i. This ensures that the degrees of individual nodes in mode 2 are preserved.- InitErgmProposal.CondDegree
MHp for

*constraints= ~degree*. Propose either 4 toggles (MH_CondDegreeTetrad) or 6 toggles (MH_CondDegreeHexad) at once. For undirected networks, propose 4 toggles (MH_CondDegreeTetrad). MH_CondDegreeTetrad selects two edges with no nodes in common, A1-A2 and B1-B2, s.t. A1-B2 and B1-A2 are not edges, and propose to replace the former two by the latter two. MH_CondDegreeHexad selects three edges A1->A2, B1->B2, C1->C2 at random and rotate them to A1->B2, B1->C2, and C1->A2.- InitErgmProposal.CondDegreeDist
MHp for

*constraints= ~degreedist*. Randomly select a node (T) and its edge (E). If the head node of the edge (H) has 1 degree more than another randomly select node (A), and A is disconnected to both T and H, then propose to toggle E and the dyad between T and A.- InitErgmProposal.CondDegreeMix
MHp for

*constraints= ~degreesmix*. Similar to`InitErgmProposal.CondDegree`

, except that the toggle is proposed only if the mixing matrix of degrees is preserved before and after the toggle.- InitErgmProposal.ConstantEdges
MHp for

*constraints= ~edges*. Propose pairs of toggles that keep number of edges the same. This is done by (a) choosing an existing edge at random; (b) repeatedly choosing dyads at random until one is found that does not have an edge; and (c) proposing toggling both these dyads. Note that step (b) will be very inefficient if the network is nearly complete, so this proposal is NOT recommended for such networks. However, most network datasets are sparse, so this is not likely to be an issue.- InitErgmProposal.CondInDegreeDist
MHp for

*constraints= ~idegreedist*. For directed networks, similar to InitErgmProposal.CondDegreeDist, except for indegree case- InitErgmProposal.CondOutDegreeDist
MHp for

*constraints= ~odegreedist*. For directed networks, similar to InitErgmProposal.CondDegreeDist, except for outdegree case- InitErgmProposal.fixedas
MHp for

*constraints=~fixedas(present,absent)*. Select a random dyad that is not in either 'present' edgelist or 'absent' edgelist to toggle. Edges in 'present' and empty dyads in 'absent' are remained fixed.- InitErgmProposal.fixedasTNT
Similar to InitErgmProposal.fixedas, except that it selects ties and non-ties for proposed toggles with equal probability. Like the unconstrained TNT proposal, this is useful for improving performance in sparse networks.

- InitErgmProposal.fixallbut
MHp for

*constraints=~fixallbut(free.dyads)*. Select a random dyad that is in free.dyads edgelist to toggle.- InitErgmProposal.fixallbutTNT
Similar to InitErgmProposal.fixallbut, except that it selects ties and non-ties for proposed toggles with equal probability. Like the unconstrained TNT proposal, this is useful for improving performance in sparse networks.

- InitErgmProposal.randomtoggleNonObserved
MHp for

*constraints= ~observed*. Randomly select a missing/non-observed dyad and propose a toggle.- InitErgmProposal.NonObservedTNT
Similar to InitErgmProposal.randomtoggleNonObserved, except that it selects ties and non-ties for proposed toggles with equal probability. Like the unconstrained TNT proposal, this is useful for improving performance in sparse networks.

- InitErgmProposal.CondInDegree
MHp for

*constraints= ~idegrees*. For directed networks, randomly select two dyads with a common head node, one having an edge one not, and propose to swap the tie from one tail to the other.- InitErgmProposal.CondOutDegree
MHp for

*constraints= ~odegrees*. For directed networks, randomly select two dyads with a common tail node, one having an edge and one not, and propose to swap the tie from one head to the other.- InitErgmProposal.BDStratTNT
Implements a TNT proposal with any subset of the following features: (1) upper bounds on degree, specified via the

`bd`

constraint's`maxout`

,`maxin`

, and`attribs`

arguments; (2) stratification of proposals according to mixing type on a vertex attribute, specified via the`strat`

hint; (3) fixation of specified mixing types on a(nother) vertex attribute, specified via the`blocks`

constraint.

Goodreau SM, Handcock MS, Hunter DR, Butts CT, Morris M (2008a).
A statnet Tutorial.
*Journal of Statistical Software*, 24(8).
https://www.jstatsoft.org/v24/i08/.

Hunter, D. R. and Handcock, M. S. (2006)
*Inference in curved exponential family models for networks*,
Journal of Computational and Graphical Statistics.

Hunter DR, Handcock MS, Butts CT, Goodreau SM, Morris M (2008b).
ergm: A Package to Fit, Simulate and Diagnose
Exponential-Family Models for Networks.
*Journal of Statistical Software*, 24(3).
https://www.jstatsoft.org/v24/i03/.

Krivitsky PN (2012). Exponential-Family Random Graph Models for Valued
Networks. *Electronic Journal of Statistics*, 2012, 6,
1100-1128. doi: 10.1214/12-EJS696

Morris M, Handcock MS, Hunter DR (2008).
Specification of Exponential-Family Random Graph Models:
Terms and Computational Aspects.
*Journal of Statistical Software*, 24(4).
https://www.jstatsoft.org/v24/i04/.

`ergm`

package, `ergm`

, `ergm-constraints`

, `ergm_proposal`

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.