Fit, Simulate and Diagnose Exponential-Family Models for Networks
Overview
An integrated set of tools to analyze and simulate networks based on exponential-family random graph models (ERGMs). 'ergm' is a part of the Statnet suite of packages for network analysis. See Hunter, Handcock, Butts, Goodreau, and Morris (2008) doi:10.18637/jss.v024.i03 and Krivitsky, Hunter, Morris, and Klumb (2023) doi:10.18637/jss.v105.i06.
NEW FEATURES
- ergm() constraint now supports handles noncontiguous attributes in a user-specified manner via a
noncontig=argument. At this time, only treating separate runs as separate blocks"split"is supported. - MCMC, CD, SAN, and MPLE sampling now produce cli progress bars.
- ergm() (
AsIs) operator can now handle character strings containing lists of terms. nodal_attributeshelp and the Nodal Attribute Specification in ERGM Terms vignette now contain instructions for how to converting frombase=andkeep=arguments deprecated sinceergm3.9.4.
BUG FIXES
- Some fixes to inadvertent partial matching and more uses of
seq_len(n)instead of1:n. (Thanks, Chung-hong ChanGitHub:@chainsawriot!) esteqargument to thesimulate.ergm()family of functions has been fixed.- Some typographical problems in the Nodal Attribute Specification in ERGM Terms vignette have been fixed.
OTHER USER-VISIBLE CHANGES
- If an
%ergmlhs%list is emptied out, it is now removed. convert_ergmlhs()has been deprecated.
Show all changes in 4.12.0Hide the rest of the changes in 4.12.0
- Verbose printing for variance-based adaptive MCMC no longer creates a wall of text.
C-LEVEL FACILITIES
- The C++ shim edge ranges now have a
size()method.
From inst/NEWS.Rd in the release
Install
Health
WARNINGwhether package can be installedr-patched-linux-x86_64
Found the following significant warnings: Rd warning: B-ergmTerm-1e2e5333.Rd:65: no hsearch.rds meta data for package ergm See ‘/home/hornik/tmp/R.check/r-patched-gcc/Work/PKGS/ergm.Rcheck/00install.out’ for details. * used C compiler: ‘gcc-16 (Debian 16.2.0-3) 16.2.0’ * used C++ compiler: ‘g++-16 (Debian 16.2.0-3) 16.2.0’
NOTER code for possible problemsr-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-x86_64
Found calls to structure() using deprecated special names: ergm/tests/testthat/test-update.network.R (.Dim: 2) '.Dim' should be changed to 'dim'.
- WARNING7 OK, 5 NOTE, 1 WARNING2026-08-24
- ERROR7 OK, 4 NOTE, 1 WARNING, 1 ERROR2026-08-23
- WARNING12 OK, 1 WARNING2026-06-09
- ERROR11 OK, 1 WARNING, 1 ERROR2026-06-08
- WARNING10 OK, 3 NOTE, 1 WARNING2026-03-10
Documentation
- Help pages
- 297 (62 internal)includes a package overview page
- Examples that run
- 68%26 run in a plain check · 7 only when donttest examples are enabled (R CMD check --as-cran) · 5 never run
- Exported functions with examples
- 37%
- Documented parameters
- 84%
- Return-value docs
- 74%
- Help pages citing references
- 15% with a bibliography file
Downloads
Repository
- PRs merged (all time)
- 68%
- Median days to close, 50 most recently updated closed issues
- 22
- Median days to close, 50 most recently updated closed PRs
- 2
Stars over time
Forks over time
Issues over time
PRs over time
Commits over time
Commit identities over time
7 development-tooling and community-health practices detected across 4 families in the upstream repository
Checks run against github.com/statnet/ergm on 2026-10-21.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
This repository shows signs of AI coding tools.
- GitHub Copilotfirst seen 2025-10-24Seen in the repository: .github/workflows/copilot-setup-steps.ymlPull request: opened by its own accountCommits: 3 by its own account · at least 3 crediting it in the message
Dependencies
Installing ergm adds 31 packages (19 with compiled code, 22 MB of source tarballs). Heaviest: stringi 11 MB, robustbase 2.2 MB, rbibutils 1.1 MB.
Show all 37 packagesHide all 37 packages
Code & Tests
Datasets
People & History
Show 2 more contributorsHide 2 contributors
Previously maintained by David R. Hunter (2.2-2 to 3.0-3) and Mark S. Handcock (2.0 to 2.2-1).
Show 5 peopleHide 5 people
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- 4.12.0Latest
- 4.11.0
- 4.10.12025-08-27 · diff ↗
- 4.9.0.12025-08-26 · diff ↗
- 4.9.0
- RR 4.5.0 released · 2025-04-11
- 4.8.1
- 4.7.52024-11-06 · diff ↗
- 4.7.12024-10-07 · diff ↗ ·
added 4 exports
param_names<-, ergm_Init_message, ergm_Init_stop, ergm_Init_warning - RR 4.4.0 released · 2024-04-24
- 4.6.02023-12-18 · diff ↗
- 4.5.0
- RR 4.3.0 released · 2023-04-21
- 4.4.02023-01-27 · diff ↗
- 4.3.22022-11-24 · diff ↗
Show 68 earlier eventsHide 68 earlier events
- 4.3.1
- 4.2.3
- 4.2.22022-06-01 · diff ↗
- 4.2.12022-05-10 · diff ↗ ·
added 8 exports
ergm_GWDECAY, ergm_edgecov_args, ergm_keyword, ergm_state_cache, search.ergmConstraints, search.ergmProposals, search.ergmReferences, shrink_into_CH - RR 4.2.0 released · 2022-04-22
- 4.1.2
- 4.0.1
- 4.0.02021-06-14 · diff ↗ ·
removed 9 exports
ergm.Cprepare, ergm.el.lasttoggle, ergm_Clist, is.durational, is.pending_update_network, pending_update_network, remove.offset.formula, to.lasttoggle.matrix, to.matrix.lasttoggleadded 28 exports
%ergmlhs%, %ergmlhs%<-, ERGM_STATE_C_CHANGED, ERGM_STATE_RECONCILED, ERGM_STATE_R_CHANGED, call.ErgmTerm, convert_ergmlhs, ergm_Cstate_clear, ergm_Init_try, ergm_SAN_slave, ergm_bd_init, ergm_dyadgen_select, ergm_mk_std_op_namewrap, ergm_no_ext.encode, ergm_preprocess_response, ergm_propagate_ext.encode, ergm_state, ergm_state_receive, ergm_state_send, get.MT_terms, is.ergm_state, is.valued, rank_test.ergm, set.MT_terms, snctrl, symmetrize, update_network, wrap.ergm_model - RR 4.1.0 released · 2021-05-18
- 3.11.02020-10-14 · diff ↗ ·
removed 7 exports
ergm.degeneracy, ergm.getglobalstats, ergm.getmodel, ergm.update.formula, network.update, newnw.extract, standardize.networkadded 4 exports
COLLAPSE_SMALLEST, LARGEST, SMALLEST, simulate_formula - RR 4.0.0 released · 2020-04-24
- 3.10.42019-06-10 · diff ↗
- 3.10.12019-05-14 · diff ↗ ·
removed 33 exports
MHproposal, MHproposal.character, MHproposal.ergm, MHproposal.formula, coef.ergm, coef.length.model, colMeans.mcmc.list, ergm.ConstraintImplications, ergm.Cprepare.el, ergm.Cprepare.miss, ergm.MHP.table, ergm.checkargs, ergm.checkbipartite, ergm.checkdirected, ergm.etamap, ergm.getMCMCsample, ergm.getterms, ergm.init.methods, ergm.mcmcslave, get.miss.dyads, gof.ergm, gof.formula, logLik.ergm, plot.mcmc.list.ergm, plot.network.ergm, simulate.ergm, simulate.formula, summary.ergm, summary.formula, summary.statistics and 3 moreadded 5 exports
ERGM_GET_VATTR_MULTIPLE_TYPES, ergm.restartCluster, is.pending_update_network, nthreads, pending_update_network - RR 3.6.0 released · 2019-04-26
- 3.9.42018-08-16 · diff ↗ ·
removed 72 exports
anova.ergm, anova.ergmlist, as.edgelist.compressed, central.network, coefficients.ergm, coef.sublength.model, degreedistfactor, delete.isolates, drawpie, dspartnerdist, enformulate.curved.ergm, enformulate.curved.formula, ergm.bounddeg, ergm.logisticdeviance, ergm.logitreg, ergm.mahalanobis, ergm.mple, espartnerdist, fix.curved.ergm, fix.curved.formula, get.free.dyads, gof.default, invert.network, is.durational.character, is.durational.ergm.model, is.durational.formula, is.durational.NULL, is.dyad.independent.conlist, is.dyad.independent.ergm, is.dyad.independent.ergm.model and 42 moreadded 28 exports
ERGM_LEVELS_SPEC, ERGM_VATTR_SPEC, as.ergm_model, as.rlebdm, control.ergm.godfather, ergm.checkbipartite, ergm.estfun, ergm.godfather, ergm_Clist, ergm_Init_abort, ergm_Init_inform, ergm_Init_warn, ergm_MCMC_sample, ergm_MCMC_slave, ergm_attr_levels, ergm_get_vattr, ergm_model, ergm_plot.mcmc.list, ergm_proposal, ergm_proposal_table, geweke.diag.mv, network.list, nparam, param_names, rlebdm, spectrum0.mvar, summary_formula, to_ergm_Cdouble - RR 3.5.0 released · 2018-04-23
- 3.8.02017-08-20 · diff ↗
- RR 3.4.0 released · 2017-04-21
- 3.7.12017-03-21 · diff ↗
- 3.7.02017-03-20 · diff ↗
- 3.6.12017-01-05 · diff ↗
- RR 3.3.0 released · 2016-05-03
- 3.6.02016-03-25 · diff ↗ ·
removed 6 exports
pattern:^InitErgmTerm.*, pattern:^InitWtErgmTerm.*, pattern:^InitConstraint.*, pattern:^InitMHP.*, pattern:^InitWtMHP.*, pattern:^InitReference.* - 3.5.12015-10-24 · diff ↗ ·
removed 6 exports
append.rhs.formula, as.edgelist, as.edgelist.matrix, as.edgelist.network, term.list.formula, vector.namesmatchadded 5 exports
is.curved, is.curved.ergm, is.curved.ergm.model, is.curved.formula, is.curved.NULL - 3.4.02015-06-16 · diff ↗ ·
removed 1 export
pattern:^[^\\.]added 169 exports
anova.ergm, anova.ergmlist, append.rhs.formula, approx.hotelling.diff.test, as.edgelist, as.edgelist.compressed, as.edgelist.matrix, as.edgelist.network, central.network, check.ErgmTerm, coef.ergm, coefficients.ergm, coef.length.model, coef.sublength.model, colMeans.mcmc.list, control.ergm, control.ergm.bridge, control.gof.ergm, control.gof.formula, control.logLik.ergm, control.san, control.simulate, control.simulate.ergm, control.simulate.formula, control.simulate.formula.ergm, degreedist, degreedistfactor, delete.isolates, drawpie, dspartnerdist and 139 more - RR 3.2.0 released · 2015-04-16
- 3.2.42014-12-14 · diff ↗
- 3.2.32014-12-11 · diff ↗
- 3.1.32014-07-19 · diff ↗
- RR 3.1.0 released · 2014-04-10
- 3.1.22014-01-31 · diff ↗
- 3.1.12013-11-28 · diff ↗
- 3.1-0
- RR 3.0.0 released · 2013-04-03
- 3.0-32012-05-28 · diff ↗
- RR 2.15.0 released · 2012-03-30
- 3.0-1
- RR 2.14.0 released · 2011-10-31
- 2.4-32011-09-19 · diff ↗
- 2.4-22011-06-15 · diff ↗
- 2.42011-05-27 · diff ↗
- RR 2.13.0 released · 2011-04-13
- 2.32011-02-03 · diff ↗
- 2.2-72010-11-23 · diff ↗
- 2.2-62010-11-03 · diff ↗
- RR 2.12.0 released · 2010-10-15
- 2.2-52010-07-24 · diff ↗
- 2.2-42010-04-22 · diff ↗
- RR 2.11.0 released · 2010-04-22
- 2.2-32010-04-05 · diff ↗
- 2.2-22010-01-14 · diff ↗
- RR 2.10.0 released · 2009-10-26
- RR 2.9.0 released · 2009-04-17
- 2.2-12009-03-08 · diff ↗
- 2.2-02009-03-01 · diff ↗
- RR 2.8.0 released · 2008-10-20
- 2.12008-04-28 · diff ↗
- 2.0-82008-04-22 · diff ↗
- RR 2.7.0 released · 2008-04-22
- 2.0-72008-04-03 · diff ↗
- 2.0-62008-03-12 · diff ↗
- 2.0-52008-02-18 · diff ↗
- 2.0-42008-02-05 · diff ↗
- 2.0-32008-02-03 · diff ↗
- 2.0-22008-01-23 · diff ↗
- 2.0-12008-01-19 · diff ↗
- 2.02008-01-14
- RR 2.6.0 released · 2007-10-03
Package metadata
- First published
- 2008-01-14
- Total releases
- 60 / 18 yrs
- License
- GPL-3 + file LICENSE OSI
- Minimum R
- ≥ 4.2
- Bundled data
- 69 KB / 13 files
- Download size
- 2.0 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("ergm")The package provides a citation file that builds its entry when R runs it. Run citation() to see it.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-24, which the citation names so these numbers can be found later. More on citing and the projects behind them.