Learn R Programming

ergm (version 4.7.1)

Fit, Simulate and Diagnose Exponential-Family Models for Networks

Description

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) and Krivitsky, Hunter, Morris, and Klumb (2023) .

Copy Link

Version

Install

install.packages('ergm')

Monthly Downloads

8,849

Version

4.7.1

License

GPL-3 + file LICENSE

Last Published

October 7th, 2024

Functions in ergm (4.7.1)

DiscUnif2-ergmProposal

TODO
CondDegreeDist-ergmProposal

MHp for degreedist constraints
CondDegreeMix-ergmProposal

MHp for degree mix constraints
DistRLE-ergmProposal

TODO
Bernoulli-ergmReference

Bernoulli reference
Exp-ergmTerm

Exponentiate a network's statistic
Unif-ergmReference

Continuous Uniform reference
CondB1Degree-ergmProposal

MHp for b1degree constraints
F-ergmTerm

Filtering on arbitrary one-term model
DiscUnifNonObserved-ergmProposal

TODO
UnifNonObserved-ergmProposal

TODO
Offset-ergmTerm

Terms with fixed coefficients
SPDyad-ergmProposal

A proposal alternating between TNT and a triad-focused proposal
NodematchFilter-ergmTerm

Filtering on nodematch
Log-ergmTerm

Take a natural logarithm of a network's statistic
S-ergmTerm

Evaluation on an induced subgraph
altkstar-ergmTerm

Alternating \(k\)-star
Curve-ergmTerm

Impose a curved structure on term parameters
Prod-ergmTerm

A product (or an arbitrary power combination) of one or more formulas
Symmetrize-ergmTerm

Evaluation on symmetrized (undirected) network
Sum-ergmTerm

A sum (or an arbitrary linear combination) of one or more formulas
DiscUnif-ergmProposal

TODO
DiscUnif-ergmReference

Discrete Uniform reference
Dyads-ergmConstraint

Constrain fixed or varying dyad-independent terms
For-ergmTerm

A for operator for terms
TNT-ergmProposal

Default MH algorithm
HammingConstantEdges-ergmProposal

TODO
asymmetric-ergmTerm

Asymmetric dyads
as.rlebdm.ergm_conlist

Extract dyad-level ERGM constraint information into an rlebdm object
b1dsp-ergmTerm

Dyadwise shared partners for dyads in the first bipartition
absdiff-ergmTerm

Absolute difference in nodal attribute
absdiffcat-ergmTerm

Categorical absolute difference in nodal attribute
StdNormal-ergmProposal

TODO
b2degrees-ergmConstraint

Preserve the receiver degree for bipartite networks
b2dsp-ergmTerm

Dyadwise shared partners for dyads in the second bipartition
b2star-ergmTerm

\(k\)-stars for the second mode in a bipartite network
b1factor-ergmTerm

Factor attribute effect for the first mode in a bipartite network
atleast-ergmTerm

Number of dyads with values greater than or equal to a threshold
Unif-ergmProposal

TODO
atmost-ergmTerm

Number of dyads with values less than or equal to a threshold
b1degree-ergmTerm

Degree for the first mode in a bipartite network
anova.ergm

ANOVA for ERGM Fits
b1mindegree-ergmTerm

Minimum degree for the first mode in a bipartite network
b1star-ergmTerm

\(k\)-stars for the first mode in a bipartite network
b1sociality-ergmTerm

Degree
b1nodematch-ergmTerm

Nodal attribute-based homophily effect for the first mode in a bipartite network
b2degree-ergmTerm

Degree for the second mode in a bipartite network
b2degrange-ergmTerm

Degree range for the second mode in a bipartite network
b2starmix-ergmTerm

Mixing matrix for \(k\)-stars centered on the second mode of a bipartite network
attrcov-ergmTerm

Edge covariate by attribute pairing
Label-ergmTerm

Modify terms' coefficient names
HammingTNT-ergmProposal

TODO
bd-ergmConstraint

Constrain maximum and minimum vertex degree
blockdiag-ergmConstraint

Block-diagonal structure constraint
StdNormal-ergmReference

Standard Normal reference
b1degrees-ergmConstraint

Preserve the actor degree for bipartite networks
b2concurrent-ergmTerm

Concurrent node count for the second mode in a bipartite network
b2cov-ergmTerm

Main effect of a covariate for the second mode in a bipartite network
b2sociality-ergmTerm

Degree
blocks-ergmConstraint

Constrain blocks of dyads defined by mixing type on a vertex attribute.
b2nodematch-ergmTerm

Nodal attribute-based homophily effect for the second mode in a bipartite network
b1concurrent-ergmTerm

Concurrent node count for the first mode in a bipartite network
check.ErgmTerm

Ensures an Ergm Term and its Arguments Meet Appropriate Conditions
cohab

Target statistics and model fit to a hypothetical 50,000-node network population with 50,000 nodes based on egocent
concurrentties-ergmTerm

Concurrent tie count
b1starmix-ergmTerm

Mixing matrix for \(k\)-stars centered on the first mode of a bipartite network
degcor-ergmTerm

Degree Correlation
b1cov-ergmTerm

Main effect of a covariate for the first mode in a bipartite network
approx.hotelling.diff.test

Approximate Hotelling T^2-Test for One or Two Population Means
b1degrange-ergmTerm

Degree range for the first mode in a bipartite network
cyclicalweights-ergmTerm

Cyclical weights
as.network.numeric

Create a Simple Random network of a Given Size
b2twostar-ergmTerm

Two-star census for central nodes centered on the second mode of a bipartite network
b1twostar-ergmTerm

Two-star census for central nodes centered on the first mode of a bipartite network
balance-ergmTerm

Balanced triads
b2factor-ergmTerm

Factor attribute effect for the second mode in a bipartite network
b2mindegree-ergmTerm

Minimum degree for the second mode in a bipartite network
degreedist-ergmConstraint

Preserve the degree distribution of the given network
coincidence-ergmTerm

Coincident node count for the second mode in a bipartite (aka two-mode) network
concurrent-ergmTerm

Concurrent node count
control.simulate.ergm

Auxiliary for Controlling ERGM Simulation
diff-ergmTerm

Difference
dsp-ergmTerm

Directed dyadwise shared partners
control.ergm

Auxiliary function for fine-tuning ERGM fitting.
degree-ergmTerm

Degree
degrange-ergmTerm

Degree range
egocentric-ergmConstraint

Preserve values of dyads incident on vertices with given attribute
degcrossprod-ergmTerm

Degree Cross-Product
edges-ergmTerm

Number of edges in the network
degree1.5-ergmTerm

Degree to the 3/2 power
dyadnoise-ergmProposal

TODO
degreedist

Computes and Returns the Degree Distribution Information for a Given Network
control.gof

Auxiliary for Controlling ERGM Goodness-of-Fit Evaluation
call.ErgmTerm

Locate and call an ERGM term initialization function.
edgecov-ergmTerm

Edge covariate
ctriple-ergmTerm

Cyclic triples
edges-ergmConstraint

Preserve the edge count of the given network
dyadnoise-ergmConstraint

A soft constraint to adjust the sampled distribution for dyad-level noise with known perturbation probabilities
control.san

Auxiliary for Controlling SAN
dyadcov-ergmTerm

Dyadic covariate
dyadnoiseTNT-ergmProposal

TODO
.dyads-ergmConstraint

A meta-constraint indicating handling of arbitrary dyadic constraints
ergm-defunct

Functions that have been removed from this package
ecoli

Two versions of an E. Coli network dataset
ergm-errors

Sensible error and warning messages by ergm initializers
ergm-internal

Internal ergm Objects
ergm-deprecated

Functions that will no longer be supported in future releases of the package
ergm.bridge.llr

Bridge sampling to evaluate ERGM log-likelihoods and log-likelihood ratios
ergm-parallel

Parallel Processing in the ergm Package
ergm.allstats

Calculate all possible vectors of statistics on a network for an ERGM
cycle-ergmTerm

k-Cycle Census
ergm

Exponential-Family Random Graph Models
degrees-ergmConstraint

Preserve the degree of each vertex of the given network
control.ergm.godfather

Control parameters for ergm.godfather().
cyclicalties-ergmTerm

Cyclical ties
density-ergmTerm

Density
control.ergm.bridge

Auxiliaries for Controlling ergm.bridge.llr() and logLik.ergm()
enformulate.curved-deprecated

Convert a curved ERGM into a form suitable as initial values for the same ergm. Deprecated in 4.0.0.
ergm-options

Global options and term options for the ergm package
equalto-ergmTerm

Number of dyads with values equal to a specific value (within tolerance)
ergm-package

ergm: Fit, Simulate and Diagnose Exponential-Family Models for Networks
ergm.design

Obtain the set of informative dyads based on the network structure.
ergm.eta

Operations to map curved ergm() parameters onto canonical parameters
ergm.getnetwork

Acquire and verify the network from the LHS of an ergm formula and verify that it is a valid network.
ergm.geodistdist

Calculate geodesic distance distribution for a network or edgelist
ergm.mple

Find a maximizer to the psuedolikelihood function
ergmHint

MCMC Hints for Exponential-Family Random Graph Models
ergmKeyword

Keywords defined for Exponential-Family Random Graph Models
ergm.godfather

A function to apply a given series of changes to a network.
ergmConstraint

Sample Space Constraints for Exponential-Family Random Graph Models
ergm.estfun

Compute the Sample Estimating Function Values of an ERGM.
ergm_MCMC_sample

Internal Function to Sample Networks and Network Statistics
ergm_SAN_slave

Internal Function to Perform Simulated Annealing
ergm_Cstate_clear

ergm_GWDECAY

Curved settings for geometric weights for the gw* terms
ergmReference

Reference Measures for Exponential-Family Random Graph Models
ergm_cutoff_message

Helper function for constructing gw* cutoff error messages
ergm_bd_init

Initializes the parameters to bound degree during sampling
ergmTerm

Terms used in Exponential Family Random Graph Models
ergm_model

Internal representation of an ergm network model
ergm_proposal_table

Table mapping reference,constraints, etc. to ERGM Metropolis-Hastings proposals
ergm_plot.mcmc.list

Plot MCMC list using lattice package graphics
ergm_proposal

Functions to initialize the ergm_proposal object
ergm_preprocess_response

Update the network and the response argument.
ergm_propagate_ext.encode

Extended states for submodels
ergm_mk_std_op_namewrap

Combine an operator term's and a subterm's name in a standard fashion.
ergmProposal

Metropolis-Hastings Proposal Methods for ERGM MCMC
ergmMPLE

ERGM Predictors and response for logistic regression calculation of MPLE
ergm_keyword

Dynamic ERGM keyword registry
ergm_symmetrize

Return a symmetrized version of a binary network
ergm_dyadgen_select

A helper function to select and construct a dyad generator for C.
ergm_edgecov_args

A common pattern for obtaining an edge covariate
ergm_state

A Representation of ERGM state
ergm_state_cache

A rudimentary cache for large objects
florentine

Florentine Family Marriage and Business Ties Data as a "network" object
faux.magnolia.high

Goodreau's Faux Magnolia High School as a network object
ergmlhs

An API for specifying aspects of an ergm model in the LHS/basis network.
faux.dixon.high

Faux dixon High School as a network object
fixallbut-ergmConstraint

Preserve the dyad status in all but the given edges
fixedas-ergmConstraint

Fix specific dyads
faux.mesa.high

Goodreau's Faux Mesa High School as a network object
fix.curved

Convert a curved ERGM into a corresponding "fixed" ERGM.
greaterthan-ergmTerm

Number of dyads with values strictly greater than a threshold
gof

Conduct Goodness-of-Fit Diagnostics on a Exponential Family Random Graph Model
g4

Goodreau's four node network as a "network" object
hamming-ergmConstraint

Preserve the hamming distance to the given network (BROKEN: Do NOT Use)
esp-ergmTerm

Directed edgewise shared partners
gwb1dsp-ergmTerm

Geometrically weighted dyadwise shared partner distribution for dyads in the first bipartition
gwb1degree-ergmTerm

Geometrically weighted degree distribution for the first mode in a bipartite network
faux.desert.high

Faux desert High School as a network object
gwnsp-ergmTerm

Geometrically weighted non-edgewise shared partner distribution
gwodegree-ergmTerm

Geometrically weighted out-degree distribution
hamming-ergmTerm

Hamming distance
gwidegree-ergmTerm

Geometrically weighted in-degree distribution
gwesp-ergmTerm

Geometrically weighted edgewise shared partner distribution
idegrange-ergmTerm

In-degree range
idegrees-ergmConstraint

Preserve indegree for directed networks
ininterval-ergmTerm

Number of dyads whose values are in an interval
idegree-ergmTerm

In-degree
isolatededges-ergmTerm

Isolated edges
localtriangle-ergmTerm

Triangles within neighborhoods
kstar-ergmTerm

\(k\)-stars
m2star-ergmTerm

Mixed 2-stars, a.k.a 2-paths
idegreedist-ergmConstraint

Preserve the indegree distribution
isolates-ergmTerm

Isolates
mcmc.diagnostics

Conduct MCMC diagnostics on a model fit
idegree1.5-ergmTerm

In-degree to the 3/2 power
gwdsp-ergmTerm

Geometrically weighted dyadwise shared partner distribution
gwdegree-ergmTerm

Geometrically weighted degree distribution
is.curved

Testing for curved exponential family
istar-ergmTerm

In-stars
intransitive-ergmTerm

Intransitive triads
kapferer

Kapferer's tailor shop data
nodecovar-ergmTerm

Covariance of undirected dyad values incident on each actor
nodecov-ergmTerm

Main effect of a covariate
nodal_attributes-API

Helper functions for specifying nodal attribute levels
nearsimmelian-ergmTerm

Near simmelian triads
nodal_attributes

Specifying nodal attributes and their levels
meandeg-ergmTerm

Mean vertex degree
nodeifactor-ergmTerm

Factor attribute effect for in-edges
molecule

Synthetic network with 20 nodes and 28 edges
mutual-ergmTerm

Mutuality
geweke.diag.mv

Multivariate version of coda's coda::geweke.diag().
mm-ergmTerm

Mixing matrix cells and margins
nodefactor-ergmTerm

Factor attribute effect
network.list

A convenience container for a list of network objects, output by simulate.ergm() among others.
nodeocov-ergmTerm

Main effect of a covariate for out-edges
get.node.attr

Retrieve and check assumptions about vertex attributes (nodal covariates) in a network
nodeicovar-ergmTerm

Covariance of in-dyad values incident on each actor
gwb2dsp-ergmTerm

Geometrically weighted dyadwise shared partner distribution for dyads in the second bipartition
nodeicov-ergmTerm

Main effect of a covariate for in-edges
gwb2degree-ergmTerm

Geometrically weighted degree distribution for the second mode in a bipartite network
is.valued

Function to check whether an ERGM fit or some aspect of it is valued
is.dyad.independent

Testing for dyad-independence
nodeocovar-ergmTerm

Covariance of out-dyad values incident on each actor
opentriad-ergmTerm

Open triads
ostar-ergmTerm

k-Outstars
odegree-ergmTerm

Out-degree
randomtoggle-ergmProposal

Propose a randomly selected dyad to toggle
odegree1.5-ergmTerm

Out-degree to the 3/2 power
nodeofactor-ergmTerm

Factor attribute effect for out-edges
nodemix-ergmTerm

Nodal attribute mixing
observed-ergmConstraint

Preserve the observed dyads of the given network
nodematch-ergmTerm

Uniform homophily and differential homophily
rank_test.ergm

A lack-of-fit test for ERGMs
nparam

Length of the parameter vector associated with an object or with its terms.
odegreedist-ergmConstraint

Preserve the outdegree distribution
sender-ergmTerm

Sender effect
shrink_into_CH

Identify the position of a point relative to the convex hull of a set of points
smallerthan-ergmTerm

Number of dyads with values strictly smaller than a threshold
param_names

Names of the parameters associated with an object.
smalldiff-ergmTerm

Number of ties between actors with similar attribute values
predict.formula

ERGM-based tie probabilities
logLikNull

Calculate the null model likelihood
simulate.formula

A simulate Method for formula objects that dispatches based on the Left-Hand Side
nsp-ergmTerm

Directed non-edgewise shared partners
logLik.ergm

A logLik() method for ergm fits.
odegrange-ergmTerm

Out-degree range
samplk

Longitudinal networks of positive affection within a monastery as a "network" object
nvattr.copy.network

Copy network- and vertex-level attributes between two network objects
sampson

Cumulative network of positive affection within a monastery as a "network" object
strat-ergmHint

Stratify Proposed Toggles by Mixing Type on a Vertex Attribute
odegrees-ergmConstraint

Preserve outdegree for directed networks
receiver-ergmTerm

Receiver effect
rlebdm

RLE-Compressed Boolean Dyad Matrix
threetrail-ergmTerm

Three-trails
to_ergm_Cdouble.network

Methods to serialize objects into numeric vectors for passing to the C side.
sparse-ergmHint

Sparse network
spectrum0.mvar

Multivariate version of coda's spectrum0.ar().
transitive-ergmTerm

Transitive triads
transitiveweights-ergmTerm

Transitive weights
search.ergmTerms

Search ERGM terms, constraints, references, hints, and proposals
snctrl

Statnet Control
summary.formula

Calculation of network or graph statistics or other attributes specified on a formula
triadic-ergmHint

Network with strong clustering (triad-closure) effects
sum-ergmTerm

Sum of dyad values (optionally taken to a power)
san

Generate networks with a given set of network statistics
summary_formula

Dispatching a summary function based on the class of the LHS of a formula.
simmelian-ergmTerm

Simmelian triads
triangle-ergmTerm

Triangles
simulate.ergm

Draw from the distribution of an Exponential Family Random Graph Model
tripercent-ergmTerm

Triangle percentage
simmelianties-ergmTerm

Ties in simmelian triads
ttriple-ergmTerm

Transitive triples
triadcensus-ergmTerm

Triad census
sociality-ergmTerm

Undirected degree
summary.ergm_model

Evaluate network summary statistics from an initialized ergm model
summary.ergm

Summarizing ERGM Model Fits
twopath-ergmTerm

2-Paths
transitiveties-ergmTerm

Transitive ties
update.network

Update the edges in a network based on a matrix
wtd.median

Weighted Median
wrap.ergm_model

Wrap a submodel's curved, empty network statistics, and extended state (read-only) specification (if present) for output from an InitErgmTerm or InitWtErgmTerm.
BDStratTNT-ergmProposal

TNT proposal with degree bounds, stratification, and a blocks constraint
CondInDegree-ergmProposal

MHp for idegree constraints
CondInDegreeDist-ergmProposal

MHp for idegreedist constraints
CondDegree-ergmProposal

MHp for degree constraints
CondB2Degree-ergmProposal

MHp for b2degree constraints
CondOutDegree-ergmProposal

MHp for odegree constraints
B-ergmTerm

Wrap binary terms for use in valued models
CondOutDegreeDist-ergmProposal

MHp for odegreedist constraints
ConstantEdges-ergmProposal

MHp for edges constraints