ergmConstraint {ergm} | R Documentation |
Sample Space Constraints for Exponential-Family Random Graph Models
Description
This page describes how to specify the constraints on the network sample space (the set of possible networks Y
, the set of networks y
for which h(y)>0
) and sometimes the baseline weights h(y)
to functions in the ergm
package. It also provides an indexed list of the constraints visible to the ergm's API. Constraints can also be searched via search.ergmConstraints
, and help for an individual constraint can be obtained with ergmConstraint?<constraint>
or help("<constraint>-ergmConstraint")
.
Specifying constraints
In an exponential-family random graph model (ERGM), the probability or density of a given network, y \in Y
, on a set of nodes is
h(y) \exp[\eta(\theta) \cdot g(y)] / \kappa(\theta),
where h(y)
is the reference distribution (particularly for valued network models), g(y)
is a vector of network statistics for y
, \eta(\theta)
is a natural parameter vector of the same length (with \eta(\theta)\equiv\theta
for most terms), \cdot
is the dot product, and \kappa(\theta)
is the normalizing constant for the distribution. A complete ERGM specification requires a list of network statistics g(y)
and (if applicable) their \eta(\theta)
mappings provided by a formula of ergmTerm
s; and, optionally, sample space \mathcal{Y}
and reference distribution h(y)
information provided by ergmConstraint
s and, for valued ERGMs, by ergmReference
s.
Constraints typically affect Y
, or, equivalently, set h(y)=0
for some y
, but some (“soft” constraints) set
h(y)
to values other than 0 and 1.
A constraints formula is a one- or two-sided formula whose left-hand side is
an optional direct selection of the InitErgmProposal
function and
whose right-hand side is a series of one or more terms separated by
"+"
and "-"
operators, specifying the constraint.
The sample space (over and above the reference distribution) is determined by iterating over the constraints terms from left to right, each term updating it as follows:
If the constraint introduces complex dependence structure (e.g., constrains degree or number of edges in the network), then this constraint always restricts the sample space. It may only have a
"+"
sign.If the constraint only restricts the set of dyads that may vary in the sample space (e.g., block-diagonal structure or fixing specific dyads at specific values) and has a
"+"
sign, the set of dyads that may vary is restricted to those that may vary according to this constraint and all the constraints to date.If the constraint only restricts the set of dyads that may vary in the sample space but has a
"-"
sign, the set of dyads that may vary is expanded to those that may vary according to this constraint or all the constraints up to date.
For example, a constraints formula ~a-b+c-d
with all constraints
dyadic will allow dyads permitted by either a
or b
but only if they are
also permitted by c
; as well as all dyads permitted by d
. If A
, B
,
C
, and D
were logical matrices, the matrix of variable dyads would be
equal to ((A|B)&C)|D
.
Terms with a positive sign can be viewed as "adding" a constraint while those with a negative sign can be viewed as "relaxing" a constraint.
Inheriting constraints from LHS network
By default, %ergmlhs%
attributes constraints
or
constraints.obs
(depending on which constraint) attached to the
LHS of the model formula or the basis=
argument will be added in
front of the specified constraints formula. This is the desired
behaviour most of the time, since those constraints are usually
determined by how the network was constructed (e.g., structural
zeros in a block-diagonal network).
For those situations in which this is not the desired behavior, a
.
term (with a positive sign or no sign at all) can be used to
manually set the position of the inherited constraints in the
formula, and a -.
(minus-dot) term anywhere in the constraints
formula will suppress the inherited formula altogether.
Constraints visible to the package
Term | Package | Description | Concepts |
---|---|---|---|
ergm | Constrain fixed or varying dyad-independent terms | directed dyad-independent operator undirected | |
ergm | Preserve the actor degree for bipartite networks | bipartite | |
ergm | Preserve the receiver degree for bipartite networks | bipartite | |
ergm | Constrain maximum and minimum vertex degree | directed undirected | |
ergm | Block-diagonal structure constraint | directed dyad-independent undirected | |
ergm | Constrain blocks of dyads defined by mixing type on a vertex attribute. | directed dyad-independent undirected | |
ergm | Preserve the degree distribution of the given network | directed undirected | |
ergm | Preserve the degree of each vertex of the given network | directed undirected | |
ergm | A soft constraint to adjust the sampled distribution for dyad-level noise with known perturbation probabilities | directed dyad-independent soft undirected | |
ergm | Preserve the edge count of the given network | ||
ergm | Preserve values of dyads incident on vertices with given attribute | directed dyad-independent undirected | |
ergm | Preserve the dyad status in all but the given edges | directed dyad-independent undirected | |
ergm | Preserve and preclude edges | directed dyad-independent undirected | |
ergm | Preserve the hamming distance to the given network (BROKEN: Do NOT Use) | directed undirected | |
ergm | Preserve the indegree distribution | directed | |
ergm | Preserve indegree for directed networks | directed | |
ergm | Preserve the observed dyads of the given network | directed dyad-independent undirected | |
ergm | Preserve the outdegree distribution | directed | |
ergm | Preserve outdegree for directed networks | directed |
All constraints
Term | dir | dyad-indep | op | undir | bip | soft |
---|---|---|---|---|---|---|
Dyads | ✔ | ✔ | ✔ | ✔ | ||
b1degrees | ✔ | |||||
b2degrees | ✔ | |||||
bd | ✔ | ✔ | ||||
blockdiag | ✔ | ✔ | ✔ | |||
blocks | ✔ | ✔ | ✔ | |||
degreedist | ✔ | ✔ | ||||
degrees | ✔ | ✔ | ||||
dyadnoise | ✔ | ✔ | ✔ | ✔ | ||
edges | ||||||
egocentric | ✔ | ✔ | ✔ | |||
fixallbut | ✔ | ✔ | ✔ | |||
fixedas | ✔ | ✔ | ✔ | |||
hamming | ✔ | ✔ | ||||
idegreedist | ✔ | |||||
idegrees | ✔ | |||||
observed | ✔ | ✔ | ✔ | |||
odegreedist | ✔ | |||||
odegrees | ✔ |
Constraints by keywords
Jump to keyword: directed dyad-independent operator undirected bipartite softdirected
Dyads bd blockdiag blocks degreedist degrees dyadnoise egocentric fixallbut fixedas hamming idegreedist idegrees observed odegreedist odegreesdyad-independent
Dyads blockdiag blocks dyadnoise egocentric fixallbut fixedas observedoperator
Dyadsundirected
Dyads bd blockdiag blocks degreedist degrees dyadnoise egocentric fixallbut fixedas hamming observedbipartite
b1degrees b2degreessoft
dyadnoiseReferences
Goodreau SM, Handcock MS, Hunter DR, Butts CT, Morris M (2008a). A statnet Tutorial. Journal of Statistical Software, 24(8). doi:10.18637/jss.v024.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). doi:10.18637/jss.v024.i03
Karwa V, Krivitsky PN, and Slavkovi\'c AB (2016). Sharing Social Network Data: Differentially Private Estimation of Exponential-Family Random Graph Models. Journal of the Royal Statistical Society, Series C, 66(3): 481-500. doi:10.1111/rssc.12185
Krivitsky PN (2012). Exponential-Family Random Graph Models for Valued Networks. Electronic Journal of Statistics, 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). doi:10.18637/jss.v024.i04