Learn R Programming

ergm (version 3.6.1)

ergm-terms: Terms used in Exponential Family Random Graph Models

Description

The function ergm is used to fit exponential random graph models, in which the probability of a given network, $y$, on a set of nodes is $h(y) \exp\{\eta(\theta) \cdot g(y)\}/c(\theta)$, where $h(y)$ is the reference measure (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)=\theta$ for most terms), and $c(\theta)$ is the normalizing constant for the distribution.

The network statistics $g(y)$ are entered as terms in the function call to ergm.

This page describes the possible terms (and hence network statistics) included in ergm package. Other packages may add their own terms, and package ergm.userterms provides tools for implementing them.

The current recommendation for any package implementing additional terms is to create a help file with a name or alias ergm-terms, so that help("ergm-terms") will list ERGM terms available from all loaded packages.

Arguments

Specifying models

Terms to ergm are specified by a formula to represent the network and network statistics. This is done via a formula, that is, an R formula object, of the form y ~ + ..., where y is a network object or a matrix that can be coerced to a network object, and , , etc, are each terms chosen from the list given below. To create a network object in R, use the network function, then add nodal attributes to it using the %v% operator if necessary.

Binary and valued ERGM terms

ergm functions such as ergm and simulate (for ERGMs) may operate in two modes: binary and weighted/valued, with the latter activated by passing a non-NULL value as the response argument, giving the edge attribute name to be modeled/simulated. Binary ERGM statistics cannot be used in valued mode and vice versa. However, a substantial number of binary ERGM statistics --- particularly the ones with dyadic indepenence --- have simple generalizations to valued ERGMs, and have been adapted in ergm. They have the same form as their binary ERGM counterparts, with an additional argument: form, which, at this time, has two possible values: "sum" (the default) and "nonzero". The former creates a statistic of the form $\sum_{i,j} x_{i,j} y_{i,j}$, where $y_{i,j}$ is the value of dyad $(i,j)$ and $x_{i,j}$ is the term's covariate associated with it. The latter computes the binary version, with the edge considered to be present if its value is not 0. Valued version of some binary ERGM terms have an argument threshold, which sets the value above which a dyad is conidered to have a tie. (Value less than or equal to threshold is considered a nontie.)

Covariate transformations

Some terms taking nodal or dyadic covariates take optional transform and transformname arguments. transform should be a function with one argument, taking a data structure of the same mode as the covariate and returning a similarly structured data structure, transforming the covariate as needed. For example, nodecov("a", transform=function(x) x^2) will add a nodal covariate having the square of the value of the nodal attribute "a". transformname, if given, will be added to the term's name to help identify it.

Terms to represent network statistics included in the <code><a rd-options="=ergm-package" href="/link/ergm?package=ergm&version=3.6.1&to=%3Dergm-package" data-mini-rdoc="=ergm-package::ergm">ergm</a></code> package

A cross-referenced html version of the term documentation is is available via vignette('ergm-term-crossRef') and terms can also be searched via search.ergmTerms.

References

  • Bomiriya, R. P, Bansal, S., and Hunter, D. R. (2014). Modeling Homophily in ERGMs for Bipartite Networks. Submitted.
  • Butts, CT. (2008). “A Relational Event Framework for Social Action.” Sociological Methodology, 38(1).
  • Davis, J.A. and Leinhardt, S. (1972). The Structure of Positive Interpersonal Relations in Small Groups. In J. Berger (Ed.), Sociological Theories in Progress, Volume 2, 218--251. Boston: Houghton Mifflin.
  • Holland, P. W. and S. Leinhardt (1981). An exponential family of probability distributions for directed graphs. Journal of the American Statistical Association, 76: 33--50.
  • Hunter, D. R. and M. S. Handcock (2006). Inference in curved exponential family models for networks. Journal of Computational and Graphical Statistics, 15: 565--583.
  • Hunter, D. R. (2007). Curved exponential family models for social networks. Social Networks, 29: 216--230.
  • Krackhardt, D. and Handcock, M. S. (2007). Heider versus Simmel: Emergent Features in Dynamic Structures. Lecture Notes in Computer Science, 4503, 14--27.

  • Krivitsky P. N. (2012). Exponential-Family Random Graph Models for Valued Networks. Electronic Journal of Statistics, 2012, 6, 1100-1128. \Sexpr[results=rd,stage=build]{tools:::Rd_expr_doi("#1")}10.1214/12-EJS696http://doi.org/10.1214/12-EJS696doi:\ifelse{latex}{\out{~}}{ }latex~ 10.1214/12-EJS696

  • Robins, G; Pattison, P; and Wang, P. (2009). “Closure, Connectivity, and Degree Distributions: Exponential Random Graph (p*) Models for Directed Social Networks.” Social Networks, 31:105-117.

  • Snijders T. A. B., G. G. van de Bunt, and C. E. G. Steglich. Introduction to Stochastic Actor-Based Models for Network Dynamics. Social Networks, 2010, 32(1), 44-60. \Sexpr[results=rd,stage=build]{tools:::Rd_expr_doi("#1")}10.1016/j.socnet.2009.02.004http://doi.org/10.1016/j.socnet.2009.02.004doi:\ifelse{latex}{\out{~}}{ }latex~ 10.1016/j.socnet.2009.02.004

  • Morris M, Handcock MS, and Hunter DR. Specification of Exponential-Family Random Graph Models: Terms and Computational Aspects. Journal of Statistical Software, 2008, 24(4), 1-24. http://www.jstatsoft.org/v24/i04
  • Snijders, T. A. B., P. E. Pattison, G. L. Robins, and M. S. Handcock (2006). New specifications for exponential random graph models, Sociological Methodology, 36(1): 99-153.

See Also

ergm package, search.ergmTerms, ergm, network, %v%, %n%

Examples

Run this code
## Not run: 
# ergm(flomarriage ~ kstar(1:2) + absdiff("wealth") + triangle)
# 
# ergm(molecule ~ edges + kstar(2:3) + triangle
#                       + nodematch("atomic type",diff=TRUE)
#                       + triangle + absdiff("atomic type"))
# ## End(Not run)

Run the code above in your browser using DataLab