Learn R Programming

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

ergm (version 4.6.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,854

Version

4.6.0

License

GPL-3 + file LICENSE

Maintainer

Pavel N. Krivitsky

Last Published

December 18th, 2023

Functions in ergm (4.6.0)

DiscUnif-ergmProposal

TODO
ConstantEdges-ergmProposal

MHp for edges constraints
DiscUnif2-ergmProposal

TODO
CondOutDegree-ergmProposal

MHp for odegree constraints
DiscUnif-ergmReference

Discrete Uniform reference
DiscUnifNonObserved-ergmProposal

TODO
Curve-ergmTerm

Impose a curved structure on term parameters
For-ergmTerm

A for operator for terms
Dyads-ergmConstraint

Constrain fixed or varying dyad-independent terms
DistRLE-ergmProposal

TODO
Offset-ergmTerm

Terms with fixed coefficients
HammingConstantEdges-ergmProposal

TODO
Log-ergmTerm

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

MHp for odegreedist constraints
Sum-ergmTerm

A sum (or an arbitrary linear combination) of one or more formulas
StdNormal-ergmReference

Standard Normal reference
HammingTNT-ergmProposal

TODO
Label-ergmTerm

Modify terms' coefficient names
Prod-ergmTerm

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

Alternating \(k\)-star
NodematchFilter-ergmTerm

Filtering on nodematch
absdiffcat-ergmTerm

Categorical absolute difference in nodal attribute
absdiff-ergmTerm

Absolute difference in nodal attribute
UnifNonObserved-ergmProposal

TODO
S-ergmTerm

Evaluation on an induced subgraph
atmost-ergmTerm

Number of dyads with values less than or equal to a threshold
StdNormal-ergmProposal

TODO
attrcov-ergmTerm

Edge covariate by attribute pairing
anova.ergm

ANOVA for ERGM Fits
Exp-ergmTerm

Exponentiate a network's statistic
Symmetrize-ergmTerm

Evaluation on symmetrized (undirected) network
TNT-ergmProposal

Default MH algorithm
F-ergmTerm

Filtering on arbitrary one-term model
as.network.numeric

Create a Simple Random network of a Given Size
Unif-ergmReference

Continuous Uniform reference
atleast-ergmTerm

Number of dyads with values greater than or equal to a threshold
asymmetric-ergmTerm

Asymmetric dyads
Unif-ergmProposal

TODO
approx.hotelling.diff.test

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

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

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

Nodal attribute-based homophily effect for the first mode in a bipartite network
blockdiag-ergmConstraint

Block-diagonal structure constraint
b1degrees-ergmConstraint

Preserve the actor degree for bipartite networks
b2sociality-ergmTerm

Degree
as.rlebdm.ergm_conlist

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

Constrain maximum and minimum vertex degree
b1sociality-ergmTerm

Degree
b1factor-ergmTerm

Factor attribute effect for the first mode in a bipartite network
b2degrees-ergmConstraint

Preserve the receiver degree for bipartite networks
b1dsp-ergmTerm

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

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

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

Balanced triads
b1degrange-ergmTerm

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

Degree for the first mode in a bipartite network
blocks-ergmConstraint

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

Dyadwise shared partners for dyads in the second bipartition
cohab

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

Main effect of a covariate for the second mode in a bipartite network
call.ErgmTerm

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

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

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

Concurrent node count for the second mode in a bipartite network
control.ergm.godfather

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

Main effect of a covariate for the first mode in a bipartite network
b1twostar-ergmTerm

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

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

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

Cyclical ties
b2mindegree-ergmTerm

Minimum degree for the second mode in a bipartite network
degree-ergmTerm

Degree
degrange-ergmTerm

Degree range
cyclicalweights-ergmTerm

Cyclical weights
dyadcov-ergmTerm

Dyadic covariate
dsp-ergmTerm

Directed dyadwise shared partners
coincidence-ergmTerm

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

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

Cyclic triples
concurrentties-ergmTerm

Concurrent tie count
concurrent-ergmTerm

Concurrent node count
degcor-ergmTerm

Degree Correlation
degcrossprod-ergmTerm

Degree Cross-Product
degree1.5-ergmTerm

Degree to the 3/2 power
b2factor-ergmTerm

Factor attribute effect for the second mode in a bipartite network
dyadnoiseTNT-ergmProposal

TODO
.dyads-ergmConstraint

A meta-constraint indicating handling of arbitrary dyadic constraints
b2starmix-ergmTerm

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

Preserve the degree distribution of the given network
egocentric-ergmConstraint

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

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

Density
ergm-defunct

Functions that have been removed from this package
control.ergm.bridge

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

Auxiliary for Controlling ERGM Fitting
control.gof

Auxiliary for Controlling ERGM Goodness-of-Fit Evaluation
ergm.design

Obtain the set of informative dyads based on the network structure.
equalto-ergmTerm

Number of dyads with values equal to a specific value (within tolerance)
cycle-ergmTerm

k-Cycle Census
ergm.bridge.llr

Bridge sampling to evaluate ERGM log-likelihoods and log-likelihood ratios
enformulate.curved-deprecated

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

Auxiliary for Controlling SAN
diff-ergmTerm

Difference
edgecov-ergmTerm

Edge covariate
ecoli

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

Parallel Processing in the ergm Package
ergm.mple

Find a maximizer to the psuedolikelihood function
ergmReference

Reference Measures for Exponential-Family Random Graph Models
ergmConstraint

Sample Space Constraints for Exponential-Family Random Graph Models
ergm-package

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

Compute the Sample Estimating Function Values of an ERGM.
ergm_dyadgen_select

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

Operations to map curved ergm() parameters onto canonical parameters
ergm_Cstate_clear

ergm.allstats

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

MCMC Hints for Exponential-Family Random Graph Models
ergm

Exponential-Family Random Graph Models
dyadnoise-ergmConstraint

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

TODO
ergm_edgecov_args

A common pattern for obtaining an edge covariate
control.simulate.ergm

Auxiliary for Controlling ERGM Simulation
ergm_plot.mcmc.list

Plot MCMC list using lattice package graphics
ergmTerm

Terms used in Exponential Family Random Graph Models
ergm_model

Internal representation of an ergm network model
degrees-ergmConstraint

Preserve the degree of each vertex of the given network
degreedist

Computes and Returns the Degree Distribution Information for a Given Network
edges-ergmConstraint

Preserve the edge count of the given network
ergm_symmetrize

Return a symmetrized version of a binary network
ergmKeyword

Keywords defined for Exponential-Family Random Graph Models
ergm_GWDECAY

Curved settings for geometric weights for the gw* terms
ergm-internal

Internal ergm Objects
ergm-options

Global options and term options for the ergm package
ergm.getnetwork

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

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

Internal Function to Sample Networks and Network Statistics
ergm_SAN_slave

Internal Function to Perform Simulated Annealing
ergm_state_cache

A rudimentary cache for large objects
ergm_proposal

Functions to initialize the ergm_proposal object
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
faux.dixon.high

Faux dixon High School as a network object
ergmMPLE

ERGM Predictors and response for logistic regression calculation of MPLE
gof

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

Dynamic ERGM keyword registry
ergm_state

A Representation of ERGM state
gwb1degree-ergmTerm

Geometrically weighted degree distribution for the first mode in a bipartite network
ergmlhs

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

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

Geometrically weighted dyadwise shared partner distribution for dyads in the first bipartition
faux.magnolia.high

Goodreau's Faux Magnolia High School as a network object
get.node.attr

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

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

Intransitive triads
is.curved

Testing for curved exponential family
esp-ergmTerm

Directed edgewise shared partners
faux.desert.high

Faux desert High School as a network object
edges-ergmTerm

Number of edges in the network
hamming-ergmTerm

Hamming distance
idegrees-ergmConstraint

Preserve indegree for directed networks
ininterval-ergmTerm

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

Isolated edges
hamming-ergmConstraint

Preserve the hamming distance to the given network (BROKEN: Do NOT Use)
geweke.diag.mv

Multivariate version of coda's coda::geweke.diag().
florentine

Florentine Family Marriage and Business Ties Data as a "network" object
isolates-ergmTerm

Isolates
gwb2dsp-ergmTerm

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

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

In-degree range
g4

Goodreau's four node network as a "network" object
nearsimmelian-ergmTerm

Near simmelian triads
ergm-deprecated

Functions that will no longer be supported in future releases of the package
network.list

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

Mean vertex degree
idegree-ergmTerm

In-degree
istar-ergmTerm

In-stars
kapferer

Kapferer's tailor shop data
gwnsp-ergmTerm

Geometrically weighted non-edgewise shared partner distribution
mm-ergmTerm

Mixing matrix cells and margins
nodeocov-ergmTerm

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

Factor attribute effect
ergm.exact

Calculate the exact loglikelihood for an ERGM
nodeicov-ergmTerm

Main effect of a covariate for in-edges
ergm-errors

Sensible error and warning messages by ergm initializers
ergm_cutoff_message

Helper function for constructing gw* cutoff error messages
ergm_bd_init

Initializes the parameters to bound degree during sampling
ergm.geodistdist

Calculate geodesic distance distribution for a network or edgelist
kstar-ergmTerm

\(k\)-stars
nvattr.copy.network

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

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

Directed non-edgewise shared partners
gwodegree-ergmTerm

Geometrically weighted out-degree distribution
is.dyad.independent

Testing for dyad-independence
localtriangle-ergmTerm

Triangles within neighborhoods
ergm_preprocess_response

Update the network and the response argument.
nodecov-ergmTerm

Main effect of a covariate
ergm_propagate_ext.encode

Extended states for submodels
fixallbut-ergmConstraint

Preserve the dyad status in all but the given edges
faux.mesa.high

Goodreau's Faux Mesa High School as a network object
gwidegree-ergmTerm

Geometrically weighted in-degree distribution
gwesp-ergmTerm

Geometrically weighted edgewise shared partner distribution
idegree1.5-ergmTerm

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

Geometrically weighted degree distribution
fixedas-ergmConstraint

Preserve and preclude edges
fix.curved

Convert a curved ERGM into a corresponding "fixed" ERGM.
idegreedist-ergmConstraint

Preserve the indegree distribution
nodecovar-ergmTerm

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

Uniform homophily and differential homophily
nodemix-ergmTerm

Nodal attribute mixing
odegree-ergmTerm

Out-degree
nodal_attributes-API

Helper functions for specifying nodal attribute levels
gwdsp-ergmTerm

Geometrically weighted dyadwise shared partner distribution
nodal_attributes

Specifying nodal attributes and their levels
search.ergmTerms

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

Generate networks with a given set of network statistics
is.valued

Function to check whether an ERGM fit or some aspect of it is valued
mutual-ergmTerm

Mutuality
molecule

Synthetic network with 20 nodes and 28 edges
m2star-ergmTerm

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

Preserve the outdegree distribution
mcmc.diagnostics

Conduct MCMC diagnostics on a model fit
nodeicovar-ergmTerm

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

Factor attribute effect for in-edges
logLikNull

Calculate the null model likelihood
logLik.ergm

A logLik method for ergm fits.
summary.ergm_model

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

Summarizing ERGM Model Fits
samplk

Longitudinal networks of positive affection within a monastery as a "network" object
odegree1.5-ergmTerm

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

Open triads
odegrees-ergmConstraint

Preserve outdegree for directed networks
simulate.ergm

Draw from the distribution of an Exponential Family Random Graph Model
simulate.formula

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

Receiver effect
observed-ergmConstraint

Preserve the observed dyads of the given network
nparam

Length of the parameter vector associated with an object or with its terms.
nodeofactor-ergmTerm

Factor attribute effect for out-edges
odegrange-ergmTerm

Out-degree range
rlebdm

RLE-Compressed Boolean Dyad Matrix
ostar-ergmTerm

k-Outstars
rank_test.ergm

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

Number of dyads with values strictly smaller than a threshold
randomtoggle-ergmProposal

Propose a randomly selected dyad to toggle
smalldiff-ergmTerm

Number of ties between actors with similar attribute values
sampson

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

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

ERGM-based tie probabilities
simmelian-ergmTerm

Simmelian triads
snctrl

Statnet Control
summary_formula

Dispatching a summary function based on the class of the LHS of a formula.
strat-ergmHint

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

Triangles
tripercent-ergmTerm

Triangle percentage
sociality-ergmTerm

Undirected degree
summary.formula

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

Three-trails
simmelianties-ergmTerm

Ties in simmelian triads
to_ergm_Cdouble.network

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

Transitive triples
twopath-ergmTerm

2-Paths
sum-ergmTerm

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

Sender effect
shrink_into_CH

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

Transitive weights
sparse-ergmHint

Sparse network
triadcensus-ergmTerm

Triad census
spectrum0.mvar

Multivariate version of coda's spectrum0.ar().
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.
transitive-ergmTerm

Transitive triads
transitiveties-ergmTerm

Transitive ties
update.network

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

Weighted Median
Bernoulli-ergmReference

Bernoulli reference
CondB2Degree-ergmProposal

MHp for b2degree constraints
B-ergmTerm

Wrap binary terms for use in valued models
BDStratTNT-ergmProposal

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

MHp for idegree constraints
CondDegree-ergmProposal

MHp for degree constraints
CondDegreeMix-ergmProposal

MHp for degree mix constraints
CondDegreeDist-ergmProposal

MHp for degreedist constraints
CondB1Degree-ergmProposal

MHp for b1degree constraints
CondInDegreeDist-ergmProposal

MHp for idegreedist constraints