Learn R Programming

⚠️There's a newer version (4.8.1) of this package.Take me there.

ergm (version 4.5.0)

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

6,396

Version

4.5.0

License

GPL-3 + file LICENSE

Maintainer

Pavel N. Krivitsky

Last Published

May 28th, 2023

Functions in ergm (4.5.0)

B-ergmTerm

Wrap binary terms for use in valued models
CondInDegreeDist-ergmProposal

MHp for idegreedist constraints
CondDegreeMix-ergmProposal

MHp for degree mix constraints
CondDegreeDist-ergmProposal

MHp for degreedist constraints
DiscUnif-ergmReference

Discrete Uniform reference
Log-ergmTerm

Take a natural logarithm of a network's statistic
DiscUnif-ergmProposal

TODO
NodematchFilter-ergmTerm

Filtering on nodematch
Label-ergmTerm

Modify terms' coefficient names
DiscUnifNonObserved-ergmProposal

TODO
HammingTNT-ergmProposal

TODO
DiscUnif2-ergmProposal

TODO
For-ergmTerm

A for operator for terms
HammingConstantEdges-ergmProposal

TODO
CondOutDegree-ergmProposal

MHp for odegree constraints
absdiff-ergmTerm

Absolute difference in nodal attribute
CondOutDegreeDist-ergmProposal

MHp for odegreedist constraints
absdiffcat-ergmTerm

Categorical absolute difference in nodal attribute
altkstar-ergmTerm

Alternating \(k\)-star
DistRLE-ergmProposal

TODO
UnifNonObserved-ergmProposal

TODO
Symmetrize-ergmTerm

Evaluation on symmetrized (undirected) network
F-ergmTerm

Filtering on arbitrary one-term model
S-ergmTerm

Evaluation on an induced subgraph
Exp-ergmTerm

Exponentiate a network's statistic
Dyads-ergmConstraint

Constrain fixed or varying dyad-independent terms
atmost-ergmTerm

Number of dyads with values less than or equal to a threshold
Unif-ergmReference

Continuous Uniform reference
attrcov-ergmTerm

Edge covariate by attribute pairing
StdNormal-ergmProposal

TODO
Unif-ergmProposal

TODO
b1concurrent-ergmTerm

Concurrent node count for the first mode in a bipartite network
b1cov-ergmTerm

Main effect of a covariate for the first mode in a bipartite network
TNT-ergmProposal

Default MH algorithm
b1degrange-ergmTerm

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

Degree for the first mode in a bipartite network
ConstantEdges-ergmProposal

MHp for edges constraints
b2cov-ergmTerm

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

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

Factor attribute effect for the second mode in a bipartite network
b1degrees-ergmConstraint

Preserve the actor degree for bipartite networks
b2starmix-ergmTerm

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

Degree range for the second mode in a bipartite network
blockdiag-ergmConstraint

Block-diagonal structure constraint
blocks-ergmConstraint

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

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

Standard Normal reference
Sum-ergmTerm

A sum (or an arbitrary linear combination) of one or more formulas
b1dsp-ergmTerm

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

Impose a curved structure on term parameters
Offset-ergmTerm

Terms with fixed coefficients
Prod-ergmTerm

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

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

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

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

Target statistics and model fit to a hypothetical 50,000-node network population with 50,000 nodes based on egocent
approx.hotelling.diff.test

Approximate Hotelling T^2-Test for One or Two Population Means
anova.ergm

ANOVA for ERGM Fits
b2sociality-ergmTerm

Degree
concurrent-ergmTerm

Concurrent node count
concurrentties-ergmTerm

Concurrent tie count
b2star-ergmTerm

\(k\)-stars for the second mode in a bipartite network
as.network.numeric

Create a Simple Random network of a Given Size
control.ergm.godfather

Control parameters for ergm.godfather().
control.gof

Auxiliary for Controlling ERGM Goodness-of-Fit Evaluation
control.ergm.bridge

Auxiliaries for Controlling ergm.bridge.llr() and logLik.ergm()
control.ergm

Auxiliary for Controlling ERGM Fitting
cycle-ergmTerm

k-Cycle Census
degreedist-ergmConstraint

Preserve the degree distribution of the given network
ctriple-ergmTerm

Cyclic triples
degree1.5-ergmTerm

Degree to the 3/2 power
control.san

Auxiliary for Controlling SAN
as.rlebdm.ergm_conlist

Extract dyad-level ERGM constraint information into an rlebdm object
dyadnoise-ergmConstraint

A soft constraint to adjust the sampled distribution for dyad-level noise with known perturbation probabilities
b1factor-ergmTerm

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

Asymmetric dyads
atleast-ergmTerm

Number of dyads with values greater than or equal to a threshold
ecoli

Two versions of an E. Coli network dataset
edgecov-ergmTerm

Edge covariate
dyadnoise-ergmProposal

TODO
degrange-ergmTerm

Degree range
b1nodematch-ergmTerm

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

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

Degree
degreedist

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

Auxiliary for Controlling ERGM Simulation
b1star-ergmTerm

\(k\)-stars for the first mode in a bipartite network
ergm.design

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

Bridge sampling to evaluate ERGM log-likelihoods and log-likelihood ratios
degrees-ergmConstraint

Preserve the degree of each vertex of the given network
ergm.eta

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

Compute the Sample Estimating Function Values of an ERGM.
b1starmix-ergmTerm

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

Degree
balance-ergmTerm

Balanced triads
ergm.exact

Calculate the exact loglikelihood for an ERGM
b2mindegree-ergmTerm

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

Preserve the receiver degree for bipartite networks
bd-ergmConstraint

Constrain maximum and minimum vertex degree
ergm-parallel

Parallel Processing in the ergm Package
b2degree-ergmTerm

Degree for the second mode in a bipartite network
ergm-package

Fit, Simulate and Diagnose Exponential-Family Models for Networks
call.ErgmTerm

Locate and call an ERGM term initialization function.
check.ErgmTerm

Ensures an Ergm Term and its Arguments Meet Appropriate Conditions
equalto-ergmTerm

Number of dyads with values equal to a specific value (within tolerance)
ergm.geodistdist

Calculate geodesic distance distribution for a network or edgelist
enformulate.curved-deprecated

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

Preserve values of dyads incident on vertices with given attribute
ergm_model

Internal representation of an ergm network model
b2nodematch-ergmTerm

Nodal attribute-based homophily effect for the second mode in a bipartite network
ergm_plot.mcmc.list

Plot MCMC list using lattice package graphics
ergmHint

MCMC Hints for Exponential-Family Random Graph Models
ergm-defunct

Functions that have been removed from this package
ergmKeyword

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

Calculate all possible vectors of statistics on a network for an ERGM
ergm

Exponential-Family Random Graph Models
ergm_Cstate_clear

ergmReference

Reference Measures for Exponential-Family Random Graph Models
esp-ergmTerm

Directed edgewise shared partners
faux.desert.high

Faux desert High School as a network object
ergm_GWDECAY

Curved settings for geometric weights for the gw* terms
florentine

Florentine Family Marriage and Business Ties Data as a "network" object
g4

Goodreau's four node network as a "network" object
ergm_dyadgen_select

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

Initializes the parameters to bound degree during sampling
ergm_edgecov_args

A common pattern for obtaining an edge covariate
ergmTerm

Terms used in Exponential Family Random Graph Models
degcor-ergmTerm

Degree Correlation
degcrossprod-ergmTerm

Degree Cross-Product
ergm_cutoff_message

Helper function for constructing gw* cutoff error messages
density-ergmTerm

Density
gwdegree-ergmTerm

Geometrically weighted degree distribution
ergm_proposal

Functions to initialize the ergm_proposal object
cyclicalties-ergmTerm

Cyclical ties
gwesp-ergmTerm

Geometrically weighted edgewise shared partner distribution
gwdsp-ergmTerm

Geometrically weighted dyadwise shared partner distribution
gwidegree-ergmTerm

Geometrically weighted in-degree distribution
faux.mesa.high

Goodreau's Faux Mesa High School as a network object
idegree1.5-ergmTerm

In-degree to the 3/2 power
fix.curved

Convert a curved ERGM into a corresponding "fixed" ERGM.
ergm_proposal_table

Table mapping reference,constraints, etc. to ERGM Metropolis-Hastings proposals
greaterthan-ergmTerm

Number of dyads with values strictly greater than a threshold
ininterval-ergmTerm

Number of dyads whose values are in an interval
idegrees-ergmConstraint

Preserve indegree for directed networks
gof

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

Preserve the indegree distribution
kstar-ergmTerm

\(k\)-stars
diff-ergmTerm

Difference
cyclicalweights-ergmTerm

Cyclical weights
logLik.ergm

A logLik method for ergm fits.
logLikNull

Calculate the null model likelihood
edges-ergmConstraint

Preserve the edge count of the given network
edges-ergmTerm

Number of edges in the network
mutual-ergmTerm

Mutuality
molecule

Synthetic network with 20 nodes and 28 edges
idegree-ergmTerm

In-degree
idegrange-ergmTerm

In-degree range
dsp-ergmTerm

Directed dyadwise shared partners
dyadcov-ergmTerm

Dyadic covariate
localtriangle-ergmTerm

Triangles within neighborhoods
nodeofactor-ergmTerm

Factor attribute effect for out-edges
nodecov-ergmTerm

Main effect of a covariate
nodecovar-ergmTerm

Covariance of undirected dyad values incident on each actor
fixallbut-ergmConstraint

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

Preserve and preclude edges
dyadnoiseTNT-ergmProposal

TODO
faux.dixon.high

Faux dixon High School as a network object
faux.magnolia.high

Goodreau's Faux Magnolia High School as a network object
gwnsp-ergmTerm

Geometrically weighted non-edgewise shared partner distribution
gwodegree-ergmTerm

Geometrically weighted out-degree distribution
meandeg-ergmTerm

Mean vertex degree
mm-ergmTerm

Mixing matrix cells and margins
ergm-deprecated

Functions that will no longer be supported in future releases of the package
nodefactor-ergmTerm

Factor attribute effect
odegreedist-ergmConstraint

Preserve the outdegree distribution
ergm.godfather

A function to apply a given series of changes to a network.
ergm.getnetwork

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

Length of the parameter vector associated with an object or with its terms.
ergm-errors

Sensible error and warning messages by ergm initializers
nodeicovar-ergmTerm

Covariance of in-dyad values incident on each actor
is.dyad.independent

Testing for dyad-independence
.dyads-ergmConstraint

A meta-constraint indicating handling of arbitrary dyadic constraints
ergm_MCMC_sample

Internal Function to Sample Networks and Network Statistics
nodeicov-ergmTerm

Main effect of a covariate for in-edges
is.valued

Function to check whether an ERGM fit or some aspect of it is valued
nvattr.copy.network

Copy network- and vertex-level attributes between two network objects
nsp-ergmTerm

Directed non-edgewise shared partners
ergm_SAN_slave

Internal Function to Perform Simulated Annealing
ergm-internal

Internal ergm Objects
odegrees-ergmConstraint

Preserve outdegree for directed networks
isolatededges-ergmTerm

Isolated edges
receiver-ergmTerm

Receiver effect
rlebdm

RLE-Compressed Boolean Dyad Matrix
ergm-options

Global options and term options for the ergm package
randomtoggle-ergmProposal

Propose a randomly selected dyad to toggle
isolates-ergmTerm

Isolates
nearsimmelian-ergmTerm

Near simmelian triads
network.list

A convenience container for a list of network objects, output by simulate.ergm among others.
samplk

Longitudinal networks of positive affection within a monastery as a "network" object
nodeifactor-ergmTerm

Factor attribute effect for in-edges
observed-ergmConstraint

Preserve the observed dyads of the given network
sampson

Cumulative network of positive affection within a monastery as a "network" object
snctrl

Statnet Control
ergm_keyword

Dynamic ERGM keyword registry
sender-ergmTerm

Sender effect
ergm.mple

Find a maximizer to the psuedolikelihood function
odegrange-ergmTerm

Out-degree range
ergm_mk_std_op_namewrap

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

Sample Space Constraints for Exponential-Family Random Graph Models
san

Generate networks with a given set of network statistics
rank_test.ergm

A lack-of-fit test for ERGMs
smallerthan-ergmTerm

Number of dyads with values strictly smaller than a threshold
smalldiff-ergmTerm

Number of ties between actors with similar attribute values
ergm_state

A Representation of ERGM state
sociality-ergmTerm

Undirected degree
ergmMPLE

ERGM Predictors and response for logistic regression calculation of MPLE
search.ergmTerms

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

Dispatching a summary function based on the class of the LHS of a formula.
ergm_state_cache

A rudimentary cache for large objects
shrink_into_CH

Identify the position of a point relative to the convex hull of a set of points
summary.formula

Calculation of network or graph statistics or other attributes specified on a formula
simmelian-ergmTerm

Simmelian triads
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.
simmelianties-ergmTerm

Ties in simmelian triads
sparse-ergmHint

Sparse network
update.network

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

Weighted Median
ergmProposal

Metropolis-Hastings Proposal Methods for ERGM MCMC
ergm_preprocess_response

Update the network and the response argument.
spectrum0.mvar

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

Triangles
tripercent-ergmTerm

Triangle percentage
gwb1degree-ergmTerm

Geometrically weighted degree distribution for the first mode in a bipartite network
gwb1dsp-ergmTerm

Geometrically weighted dyadwise shared partner distribution for dyads in the first bipartition
hamming-ergmConstraint

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

Hamming distance
strat-ergmHint

Stratify Proposed Toggles by Mixing Type on a Vertex Attribute
transitive-ergmTerm

Transitive triads
sum-ergmTerm

Sum of dyad values (optionally taken to a power)
transitiveties-ergmTerm

Transitive ties
ergm_propagate_ext.encode

Extended states for submodels
m2star-ergmTerm

Mixed 2-stars, a.k.a 2-paths
nodal_attributes

Specifying nodal attributes and their levels
mcmc.diagnostics

Conduct MCMC diagnostics on a model fit
ergm_symmetrize

Return a symmetrized version of a binary network
ergmlhs

An API for specifying aspects of an ergm model in the LHS/basis network.
geweke.diag.mv

Multivariate version of coda's coda::geweke.diag().
nodal_attributes-API

Helper functions for specifying nodal attribute levels
nodematch-ergmTerm

Uniform homophily and differential homophily
gwb2degree-ergmTerm

Geometrically weighted degree distribution for the second mode in a bipartite network
nodemix-ergmTerm

Nodal attribute mixing
get.node.attr

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

Geometrically weighted dyadwise shared partner distribution for dyads in the second bipartition
odegree1.5-ergmTerm

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

Out-degree
simulate.formula

A simulate Method for formula objects that dispatches based on the Left-Hand Side
simulate.ergm

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

Intransitive triads
summary.ergm

Summarizing ERGM Model Fits
summary.ergm_model

Evaluate network summary statistics from an initialized ergm model
ttriple-ergmTerm

Transitive triples
is.curved

Testing for curved exponential family
opentriad-ergmTerm

Open triads
istar-ergmTerm

In-stars
kapferer

Kapferer's tailor shop data
nodeocovar-ergmTerm

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

Main effect of a covariate for out-edges
twopath-ergmTerm

2-Paths
ostar-ergmTerm

k-Outstars
param_names

Names of the parameters associated with an object.
predict.formula

ERGM-based tie probabilities
threetrail-ergmTerm

Three-trails
triadcensus-ergmTerm

Triad census
to_ergm_Cdouble.network

Methods to serialize objects into numeric vectors for passing to the C side.
transitiveweights-ergmTerm

Transitive weights
Bernoulli-ergmReference

Bernoulli reference
CondB2Degree-ergmProposal

MHp for b2degree constraints
CondB1Degree-ergmProposal

MHp for b1degree constraints
CondInDegree-ergmProposal

MHp for idegree constraints
BDStratTNT-ergmProposal

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

MHp for degree constraints