NEWS  R Documentation 
NEWS file for the ergm
package
Changes in version 4.7.5
NEW FEATURES

A new hint
triadic
and associated proposalSPDyads
have been added implementing a proposal along the lines of Wang and Atchadé (2013) for more efficient sampling of models with high triadic closure. For directed networks, one type of triad (transitive, cyclical, etc.) may be specified, defaulting to transitive. This hint is enabled by default (along withsparse
). 
Adaptive MCMC code can now be given a target precision matrix as opposed to effective sample size. See help for
control.ergm()
. This is used to make missing data MCMLE more adaptive. 
Constraint
fixedas()
now hasfixed.dyads=
as its first argument, and ifpresent=
orabsent=
is passed explicitly, it will check that the LHS network conforms before proceeding. 
In
ergm()
and related, MPLE existence check can now be disabled by passingMPLE.check=FALSE
tocontrol.ergm()
. Auxiliary calls to MPLE do so by default. 
A number of improvements to
ergm.allstats()
andergm.exact()
:The statistic frequency table is grown dynamically, so the user no longer has to specify the maximum table size.
Both functions now accept the
constraints=
argument with arbitrary dyadindependent constraints.Excessive runtime check now works in terms of free dyad counts rather than network sizes.

ergm.godfather()
now takes abasis=
argument likeergm()
,simulate.ergm()
, and others. Its term options can be passed directly as well.
BUG FIXES

COLLAPSE_SMALLEST
was selecting incorrect categories under some circumstances. 
blockdiag
constraint initialization now detects when blocks are noncontiguous and stops with an error. (Previously, it would behave in undefined ways.) 
Sum
operator now handlesI()
label specifications correctly; this also fixes an error in theProd
term. 
Detection of dyadic dependence now ignores dyadic dependence of hints (since they do not affect the sample space) and auxiliaries (since they do not, in and of themselves, add dyaddependent statistics).

In
control.ergm()
,MCMC.prop=
is now passed through toSAN.prop=
. 
A bug in the auxiliary reuse code has been fixed.

A bug in
simulate.ergm()
triggered by a combination of a proposal using an auxiliary andmonitor=
argument being passed has been fixed. 
In proposal help, listing of proposal table entries works again.

nodemix()
now uses correct parameter names. 
Godambe information for the MPLE now works if the model has an offset. (Thanks, Cornelius Fritz for reporting and Michał Bojanowski for fixing.)

When constructing the starting networks for missing data MCMC, imputation of dyads is skipped if the constraints are dyaddependent, since inserting edges may break the constraint.

edgecov()
anddyadcov()
now handlenetwork
format input correctly. 
Missing data MLE code can now handle the scenarios in which the statistics in the constrained sample are constant and/or the statistics in the unconstrained sample are highly correlated.

MCMC diagnostics for nonconfidence convergence criteria no longer rely on
$target.stats
being part of the ergm object. 
Likelihood calculation is now robust to dropped parameters and parameters fixed at infinity.

Label()
operator now documents its behavior when the model is curved more clearly. 
Invalid
levels2
specification formm()
no longer causes memory errors. 
Valued proposal updater function was not being passed the current edge state.

Undefined behavior warnings flagged by CRAN's
clangasan
have been fixed.
OTHER USERVISIBLE CHANGES

A number of utilities, including
sginv
andxTAx_seigen
have been moved to statnet.common. 
LARGEST
,SMALLEST
, andCOLLAPSE_SMALLEST
now break ties lexicographically with a warning. 
absdiffcat
is now more memoryefficient during initialization. 
MCMLE estimation code for missing data MLE with high missingness fraction is more robust.

Verbose output in Hummel step length calculation code is now more concise.

Hummel step length calculation for missing data MLE will now use more test points but terminate early if the step length does not decrease after a number of attempts.

is.dyad.independent.ergm_model()
now takes an additional argument whether auxiliaries “count”.wrap.ergm_model()
detects this from itsnamewrap=
argument. 
spectrum0.mvar()
's multicollinearity detection now attempts to normalize the rotated components, discarding those that cannot be normalized (likely due to being redundant or numericanly unstable). This should be more robust than the previous approach. 
Improvements to the
ergmProposal
documentation. 
ergm_Init_stop()
,ergm_Init_warning()
, andergm_Init_message()
that behave more like their base counterparts have been added to the API.ergm_Init_abort()
,ergm_Init_warn()
, andergm_Init_info()
will eventually change to use their rlang semantics. 
edgecov()
anddyadcov()
now check that their covariate matrix has the correct dimension. 
Constraints
fixedas()
andfixallbut()
now warn when given a network whose size does not match the LHS network's. 
Nodal attribute specification documentation (
?nodal_attributes?
) now includes an example for specifyinglevels2=
levels by value. 
Miscellaneous documentation fixes.

param_names()
API now allows assignment, and its method forergm_model
objects is more explicit about whether canonical or curved parameters are being modified and when. 
ergm_model()
constructor is now generic, with methods forformula
,term_list
, andergm_model
. 
is.dyad.independent()
can now return dyadicindependence information for each term. 
control.ergm.godfather()
has been deprecated, since it is no longer used to pass term options. 
R documentation macros
\ergmTerm
,\ergmConstraint
,\ergmReference
,\ergmHint
, and\ergmProposal
. 
Some improvements to the Terms API (see Vignette), particularly in handling of dyadic dependence and auxiliaries.

Documentation improvements to extended state and network callback APIs.

The main ERGM vignette is now in HTML.
CLEVEL FACILITIES

The
khash
C API now uses anenum
type for insertion status. 
The dyad hash edgelist API has been improved, in particular with guarding against doubleinsertions and using
UnsrtELToHashEL
to turn an unsorted edgelist into a hash edgelist. Dyad generator API “upgrades” it after several show searches. 
Dyad hashmap and dyad hashset API s now offer a "strict" variant in which it is the responsibility of the caller to handle the directedness, simplifying the code. This approach is now used by the dyad hash edgelist, dyad generator, and others.

HashELInitialize()
function no longer takes thedirected
argument. Instead, it expects that any dyads passed to it be appropriately sorted. 
Calls to
Calloc()
,Realloc()
, andFree()
have been replaced with theirR_
prefixed counterparts. 
khash
no longer allows allocators to be specified via macros; they are now hardcoded to use those from R. 
NonAPI
SET_TYPEOF()
is no longer used. 
UnsrtEL
andHashEL
now have, respectively,UnsrtELSize()
andHashELSize()
methods to query their current numbers of edges stored. This should allow seamless changes to their internal representations. 
The
kvec
macro library (from https://github.com/attractivechaos/klib/) has been incorporated into the package with some modifications and is available to use for dynamic arrays (that automatically grow as needed). It can be found in/inst/include/ergm_kvec.h
. (Thanks to Adrien Le Guillou for taking the lead on this.) 
RLEBDM1D
C API now exportsFirstRLEBDM1D()
andLastRLEBDM1D()
macros, providing dyad indices of the first and the last dyad in the RLEBDM, respectively. 
ChangeStats()
function has been split intoChangeStatsDo()
andChangeStatsUndo()
, the latter only called on rejection, which speeds up MCMC and SAN when the proposal has multiple toggles. 
setListElement()
now protects the value being stored in the list before assigning it (then unprotects it), preventing potential accidental garbage collection.
Changes in version 4.6.0
NEW FEATURES

edges
constraint can now be combined with arbitrary dyadic constraints.
BUG FIXES

Syntactic fixes in documentation.

The bounded degree support in the dyad noise proposal (see
dyadnoiseergmConstraint
) has been fixed. 
Fixed a bug in the DyadGen API implementation that would sometimes cause a crash when sampling nonedges with RLEBDM (such as when combining the
edges
with some dyadic constraint). (Thanks to Benjamin Rosche (Cornell University) for the bug report.) 
A number of potential errors and vulnerabilities in C code flagged by CRAN have been fixed.

In some models, with high degree of multicollinearity among the sufficient statistics, detection thresholds were too sensitive, ultimately resulting in some standard errors being severely underestimated.
OTHER USERVISIBLE CHANGES

The proposal lookup API is now more flexible: instead of selecting one proposal, it returns a list ordered by priority and suitability. Each proposal on the list is tried in turn and can “reject” a sampling scenario at initialization, in which case the next proposal is tried. This means that “special case” proposals can offer themselves up and then pass on if it is not their special case.

In
simulate.ergm()
withobservational=TRUE
, the basis (initial network) defaults toobject$network
, notobject$newnetwork
, since the latter often has missing edges and other metadata missing. 
Documentation for defunct functions (in
ergmdefunct
) no longer includes function prototypes as they triggered CRAN warnings. 
Some changes to minimize matrix inversions and improve numerical stability.
CLEVEL FACILITIES

New C macros to simplify initialization of the standard dyad generator and bounded degree sampler.
Changes in version 4.5.0
NEW FEATURES

as.network.numeric()
no longer constructsn\times n
matrices in doing so, allowing it to scale to large, sparse networks. 
Additional arguments to
mcmc.diagnostic()
are now passed to helper functions, including plotting functions, allowing better customization. (Thanks to Fabio A. Correa.) 
Stochastic Approximation MLE method now uses adaptive subphase lengths from Snijders (2002). (Thanks Arya Karami.)

ergm can now use networkLite's
networkLite
objects in place of fullnetwork
objects. 
MPLE estimation can now provide improved standard errors via bootstrap or Godambe estimation. (Thanks to Christian Schmid.)
BUG FIXES

Geometrically weighted ("
gw*degree
" and "gw*sp
") terms now detect when they encounter a network whose statistic of interest exceeds the cutoff and stop with an informative error, rather than sometimes silently returning incorrect results. 
Fixes in final likelihood calculation when
basis=
argument is passed to theergm()
call. 
“Confidence” stopping criterion is now more robust to scale of sufficient statistics.

Better handling of invalid inputs in
predict.ergm()
. 
bd()
now checks validity of its arguments and appropriateness for the network being modeled.
OTHER USERVISIBLE CHANGES

Optimizations to various directed shared partner calculations.

gw*sp()
anddgw*sp()
terms are now just aliases of each other. 
In
dgw*sp()
terms,cutoff=
argument is not meaningful whenfixed==TRUE
and produces a warning. 
ergm.pl()
's API has changed (though the old calling convention is still supported for now). 
Some control parameters for Stochastic Approximation have been renamed, removed, or better documented.

Some improvements in term name formatting.

Documentation improvements for some terms.
CLEVEL FACILITIES

Some helper functions for printing vectors and matrices in
ergm_util.c
have been improved.
Changes in version 4.4.0
NEW FEATURES

A paper on new features in ergm 4 and later has been published in Journal of Statistical Software. Please see
citation("ergm")
for citation information. 
ergm()
,san.formula()
,ergmMPLE()
,gof.ergm()
,gof.formula()
,logLik.ergm()
,.simulate_formula.network()
, andsimulate.ergm()
now check if any of the...
arguments are unusued and issues a warning. 
A number of changes have been made to make objects returned by
ergm()
take up less memory and storage. As a result, fits from older package version may no longer work.
ergm
objects no longer include$constrained
and$constrained.obs
elements by default, making the fit objects substantially more compact. Information useful for postprocessing and diagnostics that was previously extracted from them is now stored in the$info
element. 
ergm()
now takes anewnetwork=
argument, specifying if the networks generated at the end of the estimation should be saved. The previous behaviour was to save one network per parallel chain. The new default behaviour is to save only one. 
control.ergm()
'sMCMC.return.stats=
now controls the maximum number of iterations to be stored in$sample
and$sample.obs
for diagnostics; actual MCMC samples are thinned to at most that length.mcmc.diagnostics()
code prints the information from the full and the thinned samples.


is.dyad.independent.ergm()
can now answer based on terms, sample space, or both. 
is.na(ergm)
andanyNA(ergm)
methods can now be used to test if an ERGM was fit a missing data or observational process. 
mcmc.diagnostics()
now has acompact=
argument, to optionally abbreviate statistic and/or parameter names for more compact display.
BUG FIXES

control.ergm()
's handling of consistency check between step length and termination method hs been fixed. 
Some improvements to tests; in particular, a formerly stochastically erring test is now deterministic.
OTHER USERVISIBLE CHANGES

In the
simulate()
, passingtheta0=
is now an error.
Changes in version 4.3.2
BUG FIXES

ergm_edgecov_args()
helper function now formats the network attribute names without the quotes. 
MCMC proposal lookup code is now more robust: in particular, it keeps track of which packages added which rows to the lookup table and removes those rows on unload.

Termalike documentation caching code has been optimized to work better particularly on systems with many packages installed (such as CRAN) and Windows systems (such the WinBuilder): it no longer calls slow functions such as
dependsOnPkgs()
and is smarter about minimizing the number of operations per cache read. (Thanks to Kurt Hornik for identifying the root of the problem.)
Changes in version 4.3.1
NEW FEATURES

New functions
search.ergmHints()
andsearch.ergmReferences()
can now be used to search availableergmHints
andergmReferences
, respectively. 
A new
For()
term operator to construct a list of terms with some varying parameter. 
Term API vignette is now more complete, and includes all API elements, not just the post4.0 ones.

Termalike documentation templates now also list the keywords/concepts in the termalike's documentation file. More generally, termalike documentation has been revamped to be more consistent.

ergm()
can now take a formula with an arbitrary LHS, providedbasis=
argument is supplied and is a network.
BUG FIXES

In C, prototypes of functions with no arguments now use the
(void)
placeholder. 
gof(..., GOF=~...  model)
now correctly removes the model from the set of goodnessoffit terms. 
Fixes to
plot.gof()
for bipartite networks. 
Fixes to
plot.gof()
for dense networks. 
Package manual now passes
tidy
HTML tests. (Thanks to Elin Waring for suggesting a workaround.) 
The default description for the
attr=
term argument is now more accurate.
OTHER USERVISIBLE CHANGES

Constraints and model construction code now uses the
term_list
API from statnet.common 4.7 and avoid formula manipulation, making it more robust to formulas with varying environments. 
%ergmlhs%
constraints are now inherited by default, unless theconstraints=
formula includes a.
(minus dot) term. The former behaviour was to inherit only ifconstraints=
argument had a.
. 
Some constraints' implementations are now much more memoryefficient.

Improvements to the API documentation in the Terms API vignette.

The Stepping estimation method has been removed, since all of its improvements have been incorporated into MCMLE.

The RobbinsMonro estimation algorithm has been removed, since it is currently broken and everything it does Stochastic Approximation does better.

Function
is.inCH()
has been removed, having been deprecated in favour ofshrink_to_CH()
. 
san.ergm()
has been removed, having been deprecated for having no known use case. 
Improvements to
blockdiag()
constraint,gw*sp()
, and other documentation. 
An
Init*ErgmTerm.*
function can now return anergm_model
, in which case its terms will be “pasted” into the model. 
Documentation for
san()
algorithm is now much more detailed. 
Some improvements to the
BDStratTNT
proposals.
CLEVEL FACILITIES

Some useful dynamic node and edge list data structures added and exported.
INSTALLATION

Packages tergm, networkDynamic, and latentnet are no longer Suggested to simplify testing.
Changes in version 4.2.3
NEW FEATURES

In terms
edgecov()
anddyadcov()
, the argument can now be a network.
BUG FIXES

Fixes to estimation for valued ERGMs with missing data.

Retrying and other robustification to lpSolvebased step length calculation has been added back.

Typo fixed in a rarely used storage API macro.

check.ErgmTerm()
no longer fails when a term has argument names that coincide with certain Rbase
functions. 
Bridge sampling now disables the density guard (as some briges may result in much denser networks than observed).

Syntactic fixes to documentation.

anova.ergm()
now correctly labels its tables as analysis of deviance; passing invalid inputs (e.g., nonergm
objects) now produces an informative error message.
OTHER USERVISIBLE CHANGES

Miscellaneous documentation improvements.

ergm_egecov_args()
helper function can now handle network class input. 
In the state caching, the hashes are now globally unique (with high probability) IDs regenerated at initialization. This saves the cost of computing the hash, at the cost of sometimes not detecting when a model is being reused.

.simulate_formula.network()
is now exported explicitly. This means that extension packages overriding thesimulate_formula
method fornetwork
objects can call it directly. 
In
ergm()
, the LHS no longer needs to be a network object, as long asbasis=
is provided. 
anova.ergm()
documentation no longer discusses test statistics (which were never implemented in the first place).
INSTALLATION
Since ergm only interacts with MPI clusters through the standard parallel API, a separate test for MPI has been removed, and packages snow and Rmpi are no longer Suggested.
Changes in version 4.2.2
NEW FEATURES

More
ergmKeyword
s have been added for dyadic and triadic covariates, and terms have been tagged appropriately.
BUG FIXES

Robustification of step length calculation, documentation processing, numerical optimization, and elsewhere.

Minor documentation and vignettes fixes and clarifications.
INSTALLATION

Package ergm.userterms for implementing custom ERGM terms is no longer maintained on CRAN and is instead maintained on GitHub at https://github.com/statnet/ergm.userterms. It is no longer listed as a Suggested package.
Changes in version 4.2.1
NEW FEATURES

A new framework for documenting and crossreferencing ERGM terms and termlike constructs (constraints, hints, references, and proposals) has been implemented. Each term documentation is now generated in an Roxygen block for its initialization function, generating a functionlike documentation entry, e.g.,
edgesergmTerm
,edgesergmConstraint
,sparseergmHint
,UnifergmReference
, andTNTergmProposal
, which can be invoked withergmTerm?edges
etc.. Visible terms are dynamically indexed inergmTerm
,ergmConstraint
,ergmHint
,ergmReference
, andergmProposal
. (Joyce Cheng) 
Indexing can be done by keyword (using R's concepts), whose meanings can be looked up in
ergmKeyword
. Terms cane be searched viasearch.ergmTerms
,search.ergmConstraints
, etc.. (Joyce Cheng) 
Term
nodemix
can now be passed alevels2
argument that is afactor
orcharacter
and optionally a matrix, allowing multiple cells to be mapped to the same statistic. (Joyce Cheng) 
An API has been added for caching state information on worker nodes; in particular, when making repeated calls to MCMC sampling,
ergm_model
andergm_proposal
objects are only sent the first time, and subsequent MCMC runs from the same terms and proposal use the cache. This means that they do not need to be serialized and send through the link.
BUG FIXES

Calculations are now somewhat more robust for models whose statistics have vastly different magnitudes: in particular, covariance matrices are now generally converted to correlation matrices before inversion and then scaled back, avoiding false positives for signularness detection.

Dyads
constraint now detects if any of the terms passed to it are dyaddependent and stops with an error. 
fixallbut
constraint now works for matrix input. 
The
"confidence"
convergence criterion is now more robust to nonidentifiable models. 
edgecov
anddyadcov
now detect and stop with an error when the specified network attribute is not found. 
Bugfixes in
gof
handling of bipartite networks. (Michal Bojanowski) 
as.matrix
is called in a number of places whereas.matrix.network
was called directly. 
gof.ergm
now handles missing data networks more or less correctly again. 
Loglikelihood calculation for missing data has been partially rewritten. This fixes some corner cases, as well improve speed and memory efficiency.

Miscellaneous documentation fixes and improvements. (regular contributors, and Fabio A. Correa and Jiahao Wang)
OTHER USERVISIBLE CHANGES

Almost all tests now use the
testthat
3 framework. (Joyce Cheng and Chad Klumb) 
ergm_GWDECAY
curved ERGM pattern is now exported. 
MPLE predictor matrix calculation now uses a dynamically growing hash table as its back end, which means that
MPLE.max.dyad.types=
is deprecated and does not need to be specified. 
Adaptive bridge sampling for likelihood calculation now shifts the bridge locations by an offset generated from a lowdiscrepancy sequence after each attempt in order to reduce bias due to finite number of bridges.
Hummel (2012) step length calculation now uses an improved algorithm (Krivitsky, Kuvelkar, and Hunter 2022) and uses Rglpk where available for better performance.
is.inCH
and theStepping
algorithms have been deprecated (the latter in favour ofMCMLE
).
Adaptive MCMC's burnin detection now models the burning in as exponential decay to the stationary distribution, and selects burnin based on a given amount of bias due to burning in.

approx.hotelling.diff.test
withvar.equal=TRUE
now uses a pooled estimate of autocovariance, sospectrum0.mvar
is only called once. 
MPLE estimation now returns the Hessian as well. (Previously, it was only MCMCbased methods that did.)

ergmMPLE
no longer has thefitmodel=
argument. 
ergmMPLE
with output types other than"fit"
now attach eta map information as an attribute. 
ERGM MPLE calculation no longer returns
$glm
and$glm.null
elements, instead returning$mple.lik
and$mple.null.lik
. 
ergm_model()
no longer sets an element$coef.names
, andoffset()
decorator is set on each term'scoef.names
. 
In
summary.ergm()
output,$coefs
is no longer returned. 
check.ErgmTerm()
helper function can now also capture the expressions resulting in term arguments. This incidentally fixes a regression in statistic naming ofedgecovergmTerm
anddyadcovergmTerm
effects. 
main.method="RobbinsMonro"
implementation is broken and has been disabled pending either fixing in the next release or removal. (There is nothing it can do that"StochasticApproimation"
doesn't do better. 
Term
hammingergmConstraint
implementation is broken and has been disabled pending a fix. 
Messages about inconsistent arguments for geometrically weighted terms are now a bit more consistent, as is their documentation.
PACKAGE INSTALLATION

Package Rglpk is not strictly required and has additional external library requirements on some platforms, but it is strongly recommended, as it outperforms lpSolve in most situations.
Changes in version 4.1.2
NEW FEATURES

F()
operator's filter formula can now be a simple logical or comparison expression. 
Passthrough()
operator now takes an optional boolean label= argument, which controls whether Passthrough~ will be prepended to the coefficient name; it defaults toTRUE
for backwards compatibility, though this may change in the future.
BUG FIXES

In
summary.ergm()
output, the$coefficients
element is now a matrix rather than a dataframe. This fixes some issues with duplicate term names.$coefs
is no longer returned. 
check.ErgmTerm()
no longer skips argument type check if the passed argument isNULL
. For backwards compatibility, the check is skipped if the argument is optional and the default value isNULL
. A constantERGM_VATTR_SPEC_NULL
has been added for whenNULL
is a valid (but not default) input for nodal attribute specification. 
A serious bug in calculation of geodesic distance distribution in
gof.formula()
has been fixed. (Thanks to Jeffrey Alan Smith (University of Nebraska at Lincoln) for reporting it.) 
Documentation corrections, fixes, and cleanups.

A number of memory leaks have been fixed.
OTHER USERVISIBLE CHANGES

Miscellaneous improvements to the
BDStrat*
family of proposals. 
In adaptive MCMC, burnin detection now fits an exponential decay rather than a broken stick model.
Changes in version 4.0.1
BUG FIXES

Fixes to extended state API propagation in
Passthrough
term. 
Fixes to the handling, particularly of curved terms and offsets, in the
Sum()
andOffset()
operators. 
Minor fixes and improvements to some terms' C implementations.
OTHER USERVISIBLE CHANGES

Per request of the sna maintainer,
symmetrize()
generic and methods have been renamed toergm_symmetrize
. 
Metadata set by
%ergmlhs%
is now prettyprinted.
CLEVEL FACILITIES

In the C API, the
ToggleKnownEdge()
, function now ensures that tail < head for undirected networks.
Changes in version 4.0.0
NEW FEATURES

Terms, such as
nodecov
, that take matrixvalued functions of nodal attributes now generate coefficient names from the matrix column names more sensibly. 
The
levels2
argument in termsmm
andnodemix
now accepts an argument in the form of a logical mixing matrix, selecting which mixing matrix cells should be included. 
ergmMPLE()
now has anexpand.bipartite=
argument, which, foroutput='array'
, controls whether bipartite networks' adjacency matrices are represented as rectangular or as square. Other behaviors underoutput='array'
have also been made more consistent. 
In
gof
functions, bipartite networks now have their own goodnessoffit statistics,b1degree
andb2degree
. 
Formula or functiontype nodal attribute specifications can now be more complex. In particular,
magrittrpackage
's%>%
operator can now be used on one of the sides of anmm
formula. 
nodal_attributes
documentation and vignette now have more examples. 
Nonidentifiability detection code now checks for nonvarying statistics first and handles them appropriately. See
control.ergm
for the parameters that control this handling. 
Control lists can now be specified as plain lists with sublists allocated by argument name. Function
snctrl
can provide completion in base R, RStudio, and elsewhere. 
ERGM now checks for whether an MPLE exists and warns the user if not. (Thanks to Christian Schmidt (PSU).)

Arguments to
ergm
terms can now be specified a little bit more flexibly; e.g., one can specify an unnamed argument after a named argument, as one can in an R function call. 
Curved ERGMs are no longer “second class citizens”. Curved parameters can now be passed via
coef=
andinit=
arguments rather than embedded in the formula. 
A new type of term, an operator is introduced, taking one or more
ergm
formulas as arguments and transforming their inputs and outputs allowing a wide variety of models to be specified. These include interactions for dyadindependent effects (TERM1:TERM2
andTERM1*TERM2
),B()
inary terms in valued ERGMs,Label()
,F()
ilter,Offset()
,Symmetrize()
,Sum()
,S()
ubgraph,Curve()
,NodematchFilter()
,Log()
,Exp()
,Prod()
, and others. 
A new type of MPLE,
"logitreg"
, invoked when the model is curved. 
A new term,
attrcov
, can cumulate statistics from multiple cells in the mixing matrix. 
Termes
transitiveties
andcyclicalties
now work for undirected networks (where they count undirected transitive ties). 
is.valued
is a family of methods for testing if a particular aspect of an ERGM is valued. 
Long MCMC, SAN, etc. runs can now be interrupted (i.e., with CTRLC) even from inside the C code.

update.network
can now update the network using a variety of inputs, including edgelists andergm_state
s. 
The MPLE initial method can now be used to estimate curved ERGMs without specifying the initial curved parameter. The
initialfit=
InitErgmTerm
argument andas.initialfit=
argument ofergmMPLE
have been removed. Similarly,fix.curved
andenformulate.curved
have been deprecated and may be removed in a future release. 
A mechanism for specifying “observational constraints” (
obs.constraints
) has been added toergm
, allowing more complex observation processes than just missing data to be estimated.Currently, this can be used for estimating arbitrary ERGMs on networks whose edges have been randomly flipped with known probabilities (say, to preserve privacy) (Karwa, Krivitsky, and Slavcovic, 2017) using the
dyadnoise
or observed egocentrically with alters identified (Handcock and Gile, 2010) using theegocentric
constraint.An argument
observational=
tosimulate.ergm
can specify whether the model or the observational constraint from theergm
fit should be used. 
The user can now specify “hints” on a formula to
MCMC.prop=
andobs.MCMC.prop=
arguments passed tocontrol.ergm
that can allow the MCMC sampler to select an optimal proposal for the process.Currently, the available hints are
sparse
structure, implying that the network is sparse (the default), andstrat
, implying that the dyads are grouped in blocks which should be subject to stratified sampling.This is documented in the Proposal Lookup API vignette.

ergmMPLE
output types now include"dyadlist"
, which returns the same output as"matrix"
, but without compressing the duplicate rows. 
New constraint,
blocks
has been implemented, allowing dyads for some combinations of a factor to be prohibited from toggling (i.e., fixed, or set as structural 0s). 
An MCMC proposal
BDStratTNT
has been implemented, allowing for highly efficient MCMC sampling for some special cases of bounded degree and blocklevel stratification among the dyads. 
A number of model specification settings, including
constraints
,obs.constraints
, andresponse
can be attached to the network itself using the%ergmlhs%
operator and are inherited by the respective arguments unless overridden. 
Terms
nodecovar
,nodeocovar
, and similar have been improved. (Termsnodesqrtcovar
terms had been folded into the former.) 
san
can now take into account offsets (finite and infinite). 
A new default MCMLE stopping criterion,
"confidence"
has been implemented. It performs a multivarate equivalence test, stopping if it can reject the null hypothesis that the the parameter guess is outside of a certain tolerance region around the true parameter value. If the test fails to reject, it increases the target effective size and resumes the optimization. 
Data structures for edgelists returned from MCMC, SAN, and Godfather are now allocated dynamically. This means that control parameters
*.init.maxedges
and*.max.maxeges
are no longer useful and has been removed.MCMC.maxedges
(forcontrol.ergm
andcontrol.simulate.ergm
) is retained (with an infinite default) to be used to shortcircuit a sampler that has gone degenerate. 
The
"StochasticApproxmation"
algorithm (a Cbased implementation of RobbinsMonro) now fully supports curved ERGMs. 
The
control.ergm
parameters for"StochasticApproximation"
and"RobbinsMonro"
have been reorganised. 
Limited support for multithreaded (i.e., multicore) evaluation of change statistics has been implemented. It has to be enabled at compile time and is controlled by
set.MT_terms
and related functions, andparallel.inherit.MT=
argument ofcontrol.ergm
and others. 
Controls for bridge sampling (i.e.,
control.ergm
.bridge) can now be set separately for the constrained (missing data) sample. 
The standard argument
response=
can now be arlang
style formula containing an expression in terms of edge attributes for the modelled edge value. If the expression (or the attribute) evalutes to a logical (TRUE/FALSE) variable, a binary ERGM is estimated. 
Adaptive (effective size) sampling is now possible for the
simulate.ergm
family of functions as well. 
control.simulate.ergm
control parameterMCMC.scale
can now be used to set the MCMC burnin and interval relative to those of theergm
fit. 
In
ergm
formulas, theoffset()
decorator now takes a second optional argument allowing only some of the parameters in the term to be fixed. 
ergm
is now a bit more careful about saving formulas and environments, saving memory and disk space. 
An experimental lackoffit diagnostic
rank_test.ergm
has been added. 
The sna function
symmetrize
is made into a generic and a method fornetwork
objects is implemented. 
The user term and proposal APIs has been extended significantly. A new API enables storage of information between calls that is updated with the network state, auxiliaries: terms that make available information to other terms, and many other capabilities. See the Terms API vignette for the current specification. The API remains sourcecompatible with the previous versions.
The R API for
ergm_model
takes an additional argumentextra.aux=
, which can be used to request auxiliaries by other functions, such as proposals. 
A number of auxiliaries has been implemented (see
R/InitErgmTerm.auxnet.R
) and a convenient API for evaluating network statistics on auxiliary networks is provided. 
Loglikelihood estimates and derived quantities (deviance, AIC, BIC) now also report their standard errors due to bridge sampling. Setting the
bridge.target.se
control option tocontrol.logLik.ergm
and/orcontrol.ergm.bridge
will continue sampling and accumulating samples until the estimated standard error due to bridge sampling falls below it. 
san
output now includes the sampled statistics of the network.
BUG FIXES

The package functions now work more reliably when loaded but not attached but rather invoked via
::
. 
The
Dyads
operator constraint now works correctly on undirected networks. 
Term initialization traceback printing has been robustified.

Term
nodeisqrtcovar
now initializes without error. (Thanks to YuLun Chen (NYU) for reporting the issue.) 
The MPLE code has been robustified for some corner cases (e.g., a model with 0 free parameters).

Various fixes to
predict.ergm
. (Thanks to Michal Bojanowski.) 
In
ddsp
,dnsp
,dgwdsp
, anddgwnsp
, the"RTP"
(reciprocated transitive partners) implementation has been fixed. 
Term initialization error messages are now somewhat cleaner and more informative.

Miscellaneous documentation fixes and CRAN warning fixes.
OTHER USERVISIBLE CHANGES

IMPORTANT: The
levels2=
argument ofnodemix
andmm
terms now defaults to1
(i.e., exclude the first level combination). Old behaviour is available through theversion
term option. 
IMPORTANT: In curved terms such as
gwesp
(withfixed=FALSE
), the decay parameter in the term is now ignored; the initial decay parameter must be specified as a part ofcontrol.ergm(init=...)
. Note that because MPLE for curved ERGMs has been implemented, it is optional in the first place. 
summary_formula
family of functions now dispatch based on thebasis=
argument if present, with the formula being allowed to be onesided. 
In
control.ergm
, argumentsSAN.control=
andloglik.control=
have been shortened toSAN=
andloglik=
, respectively. 
Global ERGM options and ERGM term options are now properly documented in
options?ergm
. 
The
hammingmix
term has been deprecaed. 
The convex hull testing now uses the
lpSolveAPIpackage
and is faster and more robust as a result. (Thanks to Christian Schmid (PSU).) 
enformulate.curved
family of functions has been deprecated. 
ergmfit$coef
element has been superseded byergmfit$coefficients
for consistency withglm
and others. The former still works, with a deprecation warning. Usingcoef(ergmfit)
is recommended. 
Arguments to
ergm_MCMC_sample
andergm_MCMC_slave
have changed, and similarly for SAN and CD. 
Shared partner counts in
gw*sp
and*sp
terms are now cached, resulting in a significant speedup. This can be turned off with the term optioncache.sp
. 
The term API now supports box constraints on parameters or coefficients, which may be set via
minpar
andmaxpar
elements in theInitErgmTerm
's return list. 
In the valued ERGM API, the
response
setting is now carried as an%ergmlhs%
setting"response"
. 
Some likelihood metrics, particularly the Median one, should work better now.

In the
InitErgmConstraint
API,free_dyads
can now be a function with 0 arguments, that is only evaluated if needed and is memoized (using the memoise package). 
control.ergm
parameterMPLE.constraints.ignore
can be used to suppress calculations of complex RLEBDMs for large networks if the constraint is imposed in some other fashion. 
control.ergm
obs.MCMC.*
parameters can now be set relative to the unconstrained MCMC parameters viaobs.MCMC.mul
. 
A variety of improvements and tuning parameters for the Hummel step length algorithm (
control.ergm
parametersMCMLE.steplength.*
). 
control.ergm
's*.samplesize
can now be specified as a multiple of the number of free parameters in the model, via the*.samplesize.per_theta
parameter. 
Adaptive MCMC has been significantly improved. Methods of Vats, Flegal, and Jones (2019) are used to determine the multivariate effective sample size, and automatic burnin detection now works by fitting a broken stick linear model to see where the sample statistics level out, then uses the Geweke convergence diagnostic to verify. See help for
control.ergm
and other functons for the available tuning parameters. 
A number of defaults for control parameters have changed.

The
pending_update_network
,ergm.Cprepare
, and other APIs for moving between R and C have been replaced by theergm_state
API that uses the.Call
interface. 
simulate.ergm
now has not just theergm_model
methods but alsoergm_state
methods. 
The
lasttoggle
API created for the tergm package has been removed in favour of the “extended state” API that allows client packages to implement their own states. Similarly,is.durational
family of methods has been removed. 
Information used by
print.summary.ergm
to explain the type of fit is now set inergm
. 
The
ergm_proposal_table
API now allows a more flexible specification of which constraints a proposal can enforce as opposed to which ones it does (i.e., can't not) enforce. 
The
InitErgmConstraint
andInitErgmReference
API now has the same calling convention asInit*ErgmTerm
, which enablescheck.ErgmTerm
to be used to preprocess and check their arguments. 
The
Init*Ergm*
functions now receive an optional env= argument containing the environment of the formula from which they were called. 
The
InitErgmConstraint
API now allows multiple nested constraints to be returned, to allow a proposal to address either a more general or a more specific one. 
The
do.sim=
aregument to thesimulate.ergm
family of functions has been deprecated in favor of a more consistentreturn.args=
. 
Likelihoodchange trust region (
trustregion
) code has been removed.
CLEVEL FACILITIES

Almost all of the RC interface has been transition to use the
.Call
rather than the.C
API. Some helper functions are provided ininst/include/ergm_Rutils.h
. 
Functions
ergm.eta
,ergm.etagrad
, andergm.etagradmult
have been reimplemented in C using the.Call
interface. They are available in the C API ininst/include/ergm_etamap.h
. 
inst/include/ergm_changestat.h
andinst/include/ergm_wtchangestat.h
now provide more helpful helper macros. 
InitErgmTerm
andInitErgmProposal
functions can now pass ainteger
(as opposed to anumeric
) vector to the C functions with anoutlist$iinputs
element. 
A general API for setting callback functions that are called whenever a network changes is provided. See the Network Callback API vignette.

The discordance network API has been removed in favour of the storage API.

The
khash
macro library (from https://github.com/attractivechaos/klib/) has been incorporated into the package with some modifications and is available to use, in particular, forO(1)
storage of dyad information, particularly in applications where efficient iteration over edges incident on a node is not needed. It can be found in/inst/include/ergm_khash.h
.A variety of helper data structures and functions make use of it and are also available, particularly
/inst/include/ergm_dyad_hashmap.h
. 
Additional helper APIs and data structures have been provided in
/inst/include/
. 
A
DyadGen
API implemented on the C side by/inst/include/ergm_dyadgen.h
and on the R side byergm_dyadgen_select
automatically selects sampling arbitrary dyads, sampling from an edgelist, or sampling from an RLEBDM. It obviates a number of other proposals, such asRLETNT
andlistTNT
. 
All header files exported by ergm have been prefixed with
ergm_
. (Old header file names now issue deprecation warnings.)
Changes in version 3.11.0
NEW FEATURES

ergm
now checks models for evidence of nonidentifiability (linear dependence between statistics) after MPLE and during the MCMLE and CD estimation. QR decomposition is used to attempt to identify which statistics are redundant. 
It is now possible to limit the systematic sample size taken by
MPLE
before resorting to the casecontrol likelihood using theMPLE.samplesize
control parameter (if initial fit is final) and by theinit.MPLE.samplesize
control parameter (if it is used only to initialize the MCMCbased estimation). 
A new “operator” constraint
Dyads
takesergm
formulas and constrains dyads based on which dyads affect their change statistics. 
It is now possible to calculate modelpredicted conditional and unconditional tie probabilities using
predict.ergm
andpredict.formula
. (Contributed by Michal Bojanowski.) 
The nodal attribute specification mechamism (i.e., the
attr=
andlevels=
arguments to terms) now includes a number of convenience functions and predicates, such asLARGEST
andSMALLEST
to select or exclude the most/least frequent levels, andCOLLAPSE_SMALLEST
to collapse the smallest categories into one. 
ergmMPLE
now takes aconstraints
argument and handles it and missing dyads correctly. 
san
now has the ability to take offsets into account. 
mcmc.diagnostics.ergm
now takes an argumentwhich=
to to specify which output is wanted. 
The following new model terms have been implemented:

b1dsp
,b2dsp
,gwb1dsp
, andgwb1dsp
, the bipartite versions ofdsp
andgwdsp
. 
isolatededges
, to count the number of edges that are in a single component.


A vignette for the nodal attributes UI has been added.
The
simulate.ergm
family of functions'output=
argument can no only takes a function through which the simulated networks are mapped before returning.
The
cycle
term implementation has been greatly improved. 
ergm
now takes abasis=
argument as others. 
plot.gof
now plots a blue rhombus to indicate the simulated mean.
BUG FIXES

A bug involving assumptions based on the first entry in the
lasttoggle
vector has been corrected. 
In
logLik.ergm
, degrees of freedom no longer count offsets. 
The
Dyad
type used in C code is now at least 64 bits on all systems, fixing some issues around large networks. 
A bug that made
san
fail to terminate when it had hit its target stats exactly has been corrected. 
The
as.rlebdm.edgelist
function now correctly handles the network size attribute attached to the edgelist. 
Fixed incorrect use of
MCMC.*
control parameters insan
. 
Fixed the documentation for the
object
argument toergm_proposal
, and fixed a recursive default argument toergm_proposal.character
. 
Added a workaround for a limitation of
coda::densityplot.mcmc.list
when variable names are not unique, which caused a problem inmcmc.diagnostics
pointed out by James Wells. 
The
levels
argument was removed fromstarmix
terms, as it was not functioning correctly. 
A bug in
ergmMPLE
for bipartite networks has been fixed. 
Some fixes to
approx.hotelling.diff.test
. 
Contrastive divergence runtime diagnostics now work correctly.

ergm.godfather
now handles undirected valued networks correctly. 
Per CRAN warning, none of the internal
glm
alike functions default todata=sys.parent()
anymore. 
as.network.numeric
now handles thebip
argument consistently withnetwork.initialize
. 
For bipartite terms,
NA
s in nodal attributes are now tolerated if they are in the unused bipartition. 
ergm.bridge
now correctly updates the state of the network after every bridge's burnin. (This bug did not invalidate any prior results, but it made the loglikelihoods and derived quantities reported bysummary.ergm
less accurate.) 
ergmMPLE
now handles offsets corectly when returning matrix and array output. 
Miscellaneous fixes to
predict.ergm
andergmMPLE
, particularly in handling offsets. 
Miscellaneous vignette and documentation fixes.
OTHER USERVISIBLE CHANGES

Datasets
fauxhigh
andfauxhigh.withnumericattributes
have been removed. 
Control parameters
*.Hummel.*
have been renamed to*.steplength.*
for consistency. 
Parallel multisection search for the Hummel step length is now only enabled for missing data MLE by default, and can be disabled altogether with appropriate control parameters.

Formulas are no longer attached to
ergm_model
,ergm_proposal
,ergm_conlist
, and others. 
The
simulate
family of methods has been restructured. In particular, it is now possible to callsimulate()
on anergm_model
object without reinitializing it. 
A number of improvements have been made to the nodal attribute API. In particular,
ergm_get_vattr
now has anAsIs
method that makes minimal changes to the input before returning,ergm_get_vattr.function
now propagates its arguments to the function it calls, andergm_get_vattr
now accepts a"index"
type argument representing vertex indices (a logical of appropriate length, or a nonnegative or nonpositive integer vector). 
Missing nodal attributes now generate an error in model initialization.

summary.ergm
and its printing method have been cleaned up. 
A variety of miscellaneous optimizations, coleanups, and documentation improvements.

The
InitErgmTerm
API'scheck.ErgmTerm
now acceptsNA
or""
for argument type, indicating that any type is accepted. 
In parallel computing, worker nodes now load packges
.libPaths
of the manager node. 
The following deprecated functions have been made defunct:
ergm.update.formula
,remove.offset.formula
,network.update
,ergm.getmodel
,ergm.getglobalstats
,as.edgelist.compressed
,as.network.uncompressed
,standardize.network
, andnewnw.extract
. 
san.ergm
has been deprecated, since it lacks a known use case. 
The
simulate.formula
dispatching mechanism has been rewritten to coexist with other pacakges that want to dispatch based on the LHS of the formula, particularlylme4
. Thesimulate_formula
API still works, but it may be phased out in the future. 
ergm.bridge
has has been optimised to avoid repeated calls to model and proposal initialisation.
CLEVEL FACILITIES
C export
ergm_constants.h
now exports the major and the minor version ofergm
.
Changes in version 3.10.4
OTHER USERVISIBLE CHANGES

Deprecated term argument warnings are now only printed once per session.

mcparallel
antiwarnings are now printed less frequently.
BUG FIXES

ergm
version 3.10.1 inadvertently depended on R 3.6. The dependence has been reverted to 3.5.
Changes in version 3.10.1
NEW FEATURES

In all
gw*
terms, thecutoff=
argument can now be controlled by agw.cutoff
term option. 
nobs
method has now been implemented forergm
objects. 
simulate.ergm
now takes abasis=
argument (defaulting to NULL) that it passes to simulate.formula(). 
ergm.godfather
now takes an additionalchanges.only=
argument, to return statistics relative to initial network. 
san
's internals have been singificantly updated. In particular,SAN now performs true simulated annealing, and arguments are interpreted somewhat differently.
SAN's weighting of the statistics is now determined adaptively, in approximate proportion to the standard deviation of proposal distribution of these statistics.

fix.curved
andenformulate.curved
now handle thedgw*sp
terms. 
simulate.ergm
and others now have anoutput=
argument to provide finer control over the return format. It is to be preferred over thestatsonly=
argument. 
A number of terms (see terms help) now use the new nodal attributes UI.

Hummel steplength search can now be run in parallel.

Terms
node*cov
andb*cov
can now take multiple quantitative attributes or a function that returns a quantitative attribute matrix and produce a statistic for each. 
Terms
b1sociality
andb2sociality
have been added. 
MCMLE estimation method can now checkpoint and resume optimization. See
control.ergm
'sMCMLE.checkpoint=
andMCMLE.resume=
arguments. 
A variety of documentation expansions, cleanup, and other improvements.
BUG FIXES

The default method of
ergm.stopCluster
had not been exported. 
summary.ergm
fixed for CD estimation. 
diff
term withsign.action="abs"
no longer produces a warning on bipartite undirected networks. Thanks to Damien Georges for pointing out that this warning is unnecessary. 
More robust searching for initialization functions.

Some spurious warnings fixed.

ergm
version is now stored in the fitted object; this should produce sensible warnings when, say, trying to compute asummary.ergm
on a object produced by an earlier version. 
Disambiguation help pages have been added for concepts (such as
edges
andhamming
) that have multiple roles (such as as an ERGM term and as an ERGM sample space constraint), removing duplication of aliases. 
Miscellaneous term and example documentation fixes. (Thanks to Christian Loehle and others.)
OTHER USERVISIBLE CHANGES

Lowlevel function
ergm_SAN_slave
has now been split out ofsan
likeergm_MCMC_slave
. 
Lowerlevel
simulate.ergm_model
andsan.ergm_model
have been split out ofsimulate.formula
andsan.formula
. 
gof.ergm
now uses a longerMCMC.interval
by default. 
Parallel processing “API” now handles cluster starting and stopping more intelligently. In particular,
ergm.getCluster
now automatically sets up the calling function to stop the cluster when the calling function terminantes, as well as keeping track of which packages have already been loaded on the slave nodes. 
The vignette no longer tests egocentric code.

Failure to allocate memory in the C routines now produces sensible errors.

A semiinternal
pending_udpate_network
API can be used to carry around network information between.C
calls without having to reconstruct the network. 
control.ergm
'sinit.method=
argument now overrides the candidate list when selecting initialization methods. 
network.update
is deprecated in favor of anupdate.network
method. 
standardize.network
has been deprecated, rendered obsolite by improvements to thenetwork
package method. 
simulate.ergm
now defaults to starting the simulation from the$newnetwork
element of the fit object. Thanks to Saeid Ghafouri for raising the issue and Sam Jenness, Steven Goodreau, and Martina Morris for suggesting a solution. 
simulate
methods now attach anattr(,"monitored")
to the returned statistics, indicating which statistics were generated from themonitor=
argument. 
pending_update_network
“API” is more formalized now, including methods overriding those ofnetwork
. 
control$init.method
now overrides the candidate list when selecting initialization methods. 
The main vignette no longer contains egocentric inference code. Refer to the
ergm.ego
package. 
Improvements to
plot.gof
for large networks. 
logLik.ergm(warn.dyads=)
control parameter has been replaced byoptions(ergm.loglik.warn_dyads=)
option. 
A number of previously deprecated functions are now defunct; a number of previously defunct functions have been removed.
SAN's documentation has been augmented with examples.

sociality
term's argumentsattrname
andlevels
have been deprecated. 
Most parallel calls are now a little bit more faulttolerant, retrying on error.

Chad Klumb has been added as a contributor to the package.
CLEVEL FACILITIES
Some changes to the MetropolisHastings proposal API.
Network initialization functions now return a pointer, and destroying functions free it.

Miscellaneous improvements to lowlevel C code. In particular, more of the code now runs deterministically.

Improvements to encapsulation of
Network
structures.
Changes in version 3.9.4
NEW FEATURES

A new API allows arbitrary combinations of dyadlevel sample space constraints.

Most terms that take categorical nodal attributes now have a
levels=
argument, which can be used to control the set and the ordering of the attribute levels. 
More informative error messages for term initialization.

ergm.godfather
has been reimplemented in theergm
package, along with its valued counterpart. 
New terms have been added or improved:

mm
for a more flexible specification for mixing matrix and marginal effects; 
valued versions of
sender
,receiver
,sociality
terms; 
ininterval
now allows interval openness to be specified as a character string.

A new
term.options
control parameter allows additional arguments to be passed to term initializers.
BUG FIXES

A numerical instability in penalised pseudolikelihood calculation identified by Kevin Reuning has been fixed.

An error in runtime traceplotting for models with offset terms reported by Kevin Reuning has been fixed.

An error when trying to run the RobbinsMonro algorithm with parallel processing enabled, reported by George G. Vega Yon has been fixed.

A bug in the
meandeg
term for directed networks has been fixed. 
Miscellaneous bugs in the
gof
family of functions have been fixed.
OTHER USERVISIBLE CHANGES

The coefficient names associated with terms enclosed in
offset()
are now also enclosed inoffset()
. 
summary
method forergm
now uses usesz
tests rather thant
tests, since there is no “dispersion” parameter. In addition, it no longer takes adigits=
argument. 
Handling of missing relations has been improved.

Estimation progress when
verbose=TRUE
is now a bit less verbose; useverbose=2
and up to get more information. 
The default value of the
eval.loglik=
argument toergm
is now controlled byoptions
optionergm.eval.loglik=
. 
plot.network.ergm
has been deprecated. 
Some of the unofficial APIs have been changed for consistency and ease of use:

A new set of helper functions has been added to improve handling of nodal attributes. See nodal_attributesAPI for details.

summary
method forergm
now exports a$coefficients
element (likesummary.lm
) and$devtable
is a proper table. 
New generics
nparam
andparam_names
can be used to query the number and the names of the parameters in a model. 
ergm_model
(replacingergm.getmodel
) is now a fullfledged S3 class, representing initializedergm
models. See its help for the major methods. In particular,ergm.getglobalstats
has been repalced withsummary.ergm_model
. 
simulate.formula
functions now take anergm_model
as an argument tomonitor=
. 
Constraint initializers have been renamed from
InitConstraint
toInitErgmConstraint
. The constraint implications table has been replaced withimplies
andimpliedby
constraint lists. 
Proposal initializers have been renamed from
InitMHP
(andInitWtMHP
) toInitErgmProposal
(andInitWtErgmProposal
).ergm.MHP.table
has been renamed toergm_proposal_table
. 
Reference initializers have been renamed from
InitReference
toInitErgmReference
. Return format has also been changed, replacingergm.init.methods
. 
ergm.Clist.*
functions have been refined and specialized. In particular, those that specifically return numeric vectors (not lists of numeric vectors) for passing to C code are now methods of theto_ergm_Cdouble
generic. 
ergm.getMCMCsample
andergm.mcmcslave
have been renamed toergm_MCMC_sample
andergm_MCMC_slave
respectively, and the arguments ofergm_MCMC_sample
have been made more userfriendly.

Changes in version 3.8.0
NEW FEATURES

Development of
ergm
and associated packages is now hosted on GitHub. 
Some terms, particularly
dyadcov
have been improved.
BUG FIXES

Bug fixes to contrastive divergence code.

ddsp
anddnsp
terms now work correctly for 0 shared partners. (Thanks to Wouter Spekkink for reporting this bug.) 
Miscellaneous bug fixes, typo corrections, and robustifications.
OTHER USERVISIBLE CHANGES

Terms
degreepopularity
,idegreepopularity
, andodegreepopularity
have been renamed todegree1.5
,idegree1.5
, andodegree1.5
respectively. 
Progress reports for ERGM fits and simulations are now printed using
message
, so they can be suppressed withsuppressMessages
. 
A number of functions deprecated in 2015 have been removed. See
help('ergmdefunct')
for the list.
Changes in version 3.7.1
BUG FIXES

Reverted a nonportable use of C function
alloca()
. (Thanks to Prof. Brian Ripley for pointing out the problem.)
Changes in version 3.7.0
NEW FEATURES

New term
diff
, a directed analogue toabsdiff
has been added, allowing for different ways to handle differences in nodal attributes. 
By default,
gof
now checks goodnessoffit with respect to the estimated model in addition to the specified terms. This can be used to diagnose convergence.
BUG FIXES
Terms
concurrent
,degree
,degrange
, andconcurrentties
“byarg
” argument has been corrected to “by
”.The bug in the Contrastive Divergence code that caused ERGM fits with
bd
constraint to hang has been fixed.Documentation for the curved ERGM terms has been clarified in a number of places.
Miscellaneous fixes and robustifications in the steplength code.
OTHER USERVISIBLE CHANGES

The geometric decay parameter in
gw*sp
anddgw*sp
terms has been renamed fromalpha
todecay
, for consistency withgw*degree
terms. 
It is now explicitly an error to pass a
control=
parameter to the function directly. (Previously, such parameters were silently ignored.)
Changes in version 3.6.1
BUG FIXES
The implementation of the bounded degree (
bd
) constraint had a bug that distorted somewhat the distribution of networks simulated (and therefore estimated) away from the boundary of the constraint.Vertex labels in the
sampson
andsamplike
datasets have been corrected. (Thanks to Dr. Linda Tan Siew Li for pointing this error out.)Use of the deprecated
unix.time
has been changed tosystem.time
.Miscellaneous fixes to the documentation and robustifications.
Changes in version 3.6.0
NEW FEATURES

A new suite of geometricallyweighted family of terms has been added that allow the user to specify what directions of shared partnerships are of interest. The new terms are,
(Directed) geometrically weighted dyadwise shared partners (
dgwdsp
)(Directed) geometrically weighted edgewise shared partners (
dgwesp
)(Directed) geometrically weighted nonedgewise shared partners (
dgwnsp
)
In addition, terms for specific shared partner counts (
ddsp
,desp
, anddnsp
) have been implemented. Seeergmterms
for help. New terms (binary and valued)
b1cov
andb2cov
have been implemented, analogous tonodecov
,nodeicov
, andnodeocov
but for bipatite networks.New valued terms
atleast
,equalto
, andsmallerthan
have been implemented. A number of terms that were binaryonly before have been implemented for valued ERGMs.
ergm
package now works when loaded (e.g., usingrequireNamespace
) but not attached (e.g., usinglibrary
).
BUG FIXES
A number of implementation bugs in the valued ERGM terms have been fixed.
Parallel processing when using
ergm.userterms
and similar was accidentaly broken in the previous release.Calculation of Hummel et. al. (2010) steplength for missing data MLE was incorrect; a slower but more accurate algorithm is now used.
Miscellaneous bugfixes and robustifications.
gof.formula
and others now work with missing data.Miscelaneous cleanups and bug fixes.
OTHER USERVISIBLE CHANGES
robust.inverse
has been deprecated in favor ofginv
.simulate.formula
now does parallel processing more efficiently.
Changes in version 3.5.1
NEW FEATURES
Added a new generic,
is.curved
that tests if a given ERGM or model is curved.Blockdiagonal sampler now handles bipartite networks.
Code for parallel calculation has been optimized to provide a bigger gain from multiple cores/processors/nodes.
Bridge sampling to evaluate the loglikelihood at the MLE now prints out a brief progress report by default.
BUG FIXES
MPLE is no longer used if the model is curved and target statistics are passed, as that caused problems.
MCMC standard error calculation, "dropping" of extreme terms, main MC MLE loop, and other places have been made more robust to weird combinations of estimating problems (e.g., curved terms + target statistics + offset terms + poor starting value).

threepath
has been deprecated in favor ofthreetrail
to more accurately reflect what is being computed. The "naive" loglikelihood ratio metric now handles offsets more robustly.
The null loglikelihood calculation prints messages instead of throwing warnings.
The closedform solution (see Hummel et al., 2010) for the "lognormal" metric had been inadvertantly disabled. It has been reenabled.
Many documentation fixes and clarifications.
OTHER USERVISIBLE CHANGES
Skye BenderdeMoll has been added as a contributor to the package.
Hummel et al.'s convex hull calculation and MCMC SE calculation have been robustified against highly correlated sample statistics by using PCA to rotate them into an orthogonal configuration.
Some functions, particularly
ERRVL
,append.rhs.formula
,vectors.namesmatch
,term.list.formula
, andergm.update.formula
have been moved to thestatnet.common
package.The
as.edgelist
family of functions have been moved to thenetwork
package.
mcmc.diagnostics.ergm
now takes theesteq=
argument. IfTRUE
, the diagnostics are performed on the simulated values of the estimating functions. IfFALSE
, they are performed on simulated values of canonical statistics. This obviates and replaces the thecurved=
argument. 
san
when used with curved models now requires canonical statistics as targets.
Changes in version 3.4
NEW FEATURES
Added message to notify when ergm MCMLE does not converge after max iterations.
Copied the combined Sampson monks dataset to ergm. See
?sampson
.ergm simulation, bridge, and logLik functions now "inherit" the parallel setting from the ergm object and generally pass it along when possible.
A new estimate type and source for initial values, contrastive divergence, has been added. It is intended primarily for obtaining initial values for MCMLE for valued ERGMs and ERGMs with complex (e.g., degree and edgecount) constraints. For binary networks with dyadindependent constraints, MPLE still generally works better and remains the default.
To obtain the contrastive divergence estimate, call
ergm
withestimate="CD"
.
BUG FIXES
Fixed issue where constraints was not appropriately compared to older version
Fixed bug where the deviance of dyadindependence models was incorrectly computed/reported for all models
Removed
Rglpk
package dependency; replaced it withlpSolve
package dependency. See man page foris.inCH
for detailsFixed integer overflow bug in sample size reporting
Fixed bug in saving target.stats vector. Offset terms in target.stats output are now NA instead of the SAN network stats. (issue #1049)
Fixed ergm segfault when unknown node attributes are used in ergm formulas. Modified get.node.attr function so that it will check if specified attribute exists. (previous code only checked if network was bipartite). (issue #1140, reported by Philip Leifeld)
Implemented solution to MCMLE steplength getting stuck at 0 for some models where initial networks are very far from target stats. If the Hummel step length is < control$MCMLE.steplength.min, stop with an informative error message, reporting that the the starting value is poor. If using target stats, try increasing SAN parameters, or your configuration may be impossible or unlikely. (This suggests a poor model for the observed data.) MCMLE.steplength.min=0.0001 by default. Estimation will stop with an error message when steplen is smaller than the min for 2 iterations. (issue #1089)
Replaced the integer function abs() by floating point function fabs() in MHproposals_degree.c.
Various documentation corrections and fixes
OTHER USERVISIBLE CHANGES
ergm
withestimate="MPLE"
will now refuse to estimate the MPLE for valued ERGMs, curved ERGMs, and ERGMs with certain complex constraints, as true MPLE for these is not yet implemented.CRANrequested code structure changes (generally not visable to user):

require
andlibrary
calls changed torequireNamespace
and namespace prefixes added to calls from other packages, S3 methods explicitly registered in
NAMESPACE
.
packageDescription
is no longer used in package citation methods. Many formerly 'internal' functions have been documented in a semistable API for use by developers of other ergmrelated packages.
Many formerly undocumented 'internal' functions have been made internal by the
NAMESPACE
. As far as we know, this avoids functions in use by reverseDepending packages. These currently appear as commented items in theNAMESPACE
file.Many undocumented 'internal' functions that do not appear to be used have been deprecated and will likely be removed in the next release. See
?ergm_deprecated
for a list. If called, these functions will give a Deprecation warning and suggest an alternate function where appropriate.

Changes in version 3.2.4
NEW FEATURES
ergm MCMLE estimation, by default, uses the stepping algorithm by Hummel et al (2012) to determine step length, and terminates estimation when the step length = 1 for two consecutive iterations. The old method (from version 3.1) is still available by setting control parameter
MCMLE.termination="Hotelling"
.As a result of using Hummel stepping algorithm, the final MCMC sample average may be different from the observed statistics. This is reflected in
mcmc.diagnostics()
: these plots can no longer be used to ensure that the mean statistics from the model match the observed network statistics. For that functionality, please use the GOF command:gof(object, GOF=~model)
.Default ergm MCMC parameters changed to
MCMC.interval=1024, MCMC.samplesize=1024, MCMC.burnin=MCMC.interval*16
. The final sample size in the Hummel stepping algorithm is boosted by a factor ofMCMLE.last.boost
Default values for a number of other control parameters have changed, see CHANGES below.
Parallel functionality: ergm can take usercreated clusters as the parallel control parameter. This is the recommended method for using ergm on a highperformance computing cluster. See ergmparallel. Functionality now implemented via the
parallel
package, direct dependence onsnow
package is removedNew helper function
search.ergmTerms()
function which through theergm.terms
help page and prints out a list of terms appropriate for the specified network's structural constraints, optionally restricting by additional categories and keyword matches.The estimated covariance matrix of the ergm estimate can be extracted using
vcov
function.New EXPERIMENTAL Effective Sample Size (ESS) feature to adaptively determine MCMC length needed to get the specified effective size. Set
MCMC.effectiveSize
to nonNULL to enable this functionality; 50 is a reasonable value. Includes newergm.control
parameters
MCMC.effectiveSize=NULL

MCMC.effectiveSize.damp=10

MCMC.effectiveSize.maxruns=1000

MCMC.effectiveSize.base=1/2

MCMC.effectiveSize.points=5

MCMC.effectiveSize.order=0.1

MCMLE.MCMC.max.ESS.frac

SAN.control now includes an
MPLE.max.dyad.types
parameter which defaults to the value of the ergm.control parameter of the same name.
Addition of the
StdNormal
reference distribution. See?ergm.references
New ergm terms:

b1mindegree, b2mindegree
Minimum degree for the designated mode in a bipartite network 
b1nodematch, b2nodematch
Nodal attributebased homophily effect for the designated mode in a bipartite network.


Additional arguments added to the
network.update
function to control which attributes and properties are updated. 
new
esteq
argument forsimulate.formula
andsimulate.ergm
: Default is FALSE. If TRUE, compute the sample estimating equations of an ERGM. If the model is linear, all nonoffset statistics are passed. If the model is curved, the score estimating equations (3.1) by Hunter and Handcock (2006) are given instead. New and expanded tests of the ergm functions for use with R CMD CHECK tools.
Addition of
is.durational
methods for models and formulas. These functions test whether the terms in an ERGM model or formula is duration dependent or not. If the formula or model does not include any terms that need information about the duration of existing ties, the ergm process can use more efficient internal data structures. This is mostly in support oftergm
functionality.New ergm constraint terms:
fixallbut(free.dyads)
,fixedas(present,absent)
. The former one can specify the set of dyads (as an edgelist or a network object) to be fixed, the latter one can specify two sets of dyads (as edgelists or networks objects), to be fixed present and fixed absent respectively. See?ergm.constraints
Potential speed/memory usage improvement: sampling algorithms in both R can C levels are optimized.
ergm now imports the
network
package via NAMESPACE to avoid internal namespace collisions when used withiGraph
CHANGES

MCMC control parameters changes in
control.ergm
default for
MCMC.interval
increased from 100 to 1000default for
MCMC.burnin
changed from 10000 to mcmc.interval*16default for
MCMC.samplesize
decreased from 10000 to 1024
MCMLE control parameter changes in
control.ergm
a new control argument
MCMLE.termination
has been added to specify the criterion used for terminating MCMLE estimation.a new
MCMLE.metric
argument'logtaylor'
has been addedcontrol parameter
MCMCLE.steplength.margin
has been addeddefault value for
MCMLE.MCMC.precision
has been increased from 0.05 to 0.005default value for
MCMLE.steplength
has been changed from 0.5 to 1

ergm.control parameter
SA.nsubphases
default changed from MCMLE.maxit to 4 
control.gof parameter
MCMC.burnin
default increased from 1000 to 10000 
similarly, the default for the
MCMC.burnin
control parameter forcontrol.simulate
,control.simulate.formula
andcontrol.simulate.formula.ergm
increased from 1000 to 10000
BUG FIXES
Networks where some statistics are at the lowest value, leading to some terms being Inf, was not giving the correct estimated coefficients. Now fixed.
Bug fix in Penalizedlikelihood MPLE estimation
Bug fix in MPLE estimation when ergm edgecov term has an attribute as a matrix.
Bug fix in ergm nodecov term when attributes are specified only for the second mode in a bipartite network
Various compatibility improvements to avoid warnings from R 3.1.2 and 3.1.3
control parameter
MPLE.max.dyad.types
is now passed tologLik.ergm()
andergm.bridge.dindstart.llk()
. fixes issue reported by Sebastian DazaFixed a fencepost bug in
ergm.bridge.dindstart.llk()
's construction of the offset coefficient vector in the dyadindependent submodel reported by Philip LeifeldAdjusted package initialization code to avoid throwing error reported by Philip Leifeld when ergm imported by another package instead of attached to workspace.

Fixed a bug with
ergm.pl
not dropping the appropriate rows when there are Infs. When network stats are 0, the glm model should now be specified correctly. Reported by Kevin Lewis Many other fixes...
DEPRECATED & DEFUNCT
The ergm control parameter
MCMLE.method
has been deprecated. By default, ergm usestrust
, and falls back tooptim
with NelderMead method whentrust
fails.The ergm control parameter
MCMLE.adaptive.epsilon
has been removed.The ergm control parameters
MCMC.burnin.retries
,MCMC.burnin.check.last
andMCMC.burnin.check.alpha
have been removed.
MCMLE.adaptive.epsilon
parameter has been removed The
faux.high
dataset was removed as it was identical tofaux.mesa.high
OTHER USERVISIBLE CHANGES
The "iterations" output in an ergm object now returns the number of MCMLE iterations taken by the estimation.
New help page for ergm MetropolisHastings Proposal methods.
Changes in version 3.1.3
BUG FIXES
An array bounds issue was fixed in the
C
code. It has not affected any previous output.Some spurious convergence warnings are no longer printed by
summary.ergm
.Bugs in the valued Uniform and Discrete Uniform MetropolisHastings proposals for missing dyads have been fixed.
Term
edgecov
invoked with the network attribute syntax now checks for the presence of the network attribute in question.
DEPRECATED & DEFUNCT
Calling
ergm
, withestimate="MPLE"
for a curved exponential family model (e.g.,gwesp
withfixed=FALSE
) is now an error. (Previously, it treated the curved term as fixed, which was misleading.)
Changes in version 3.1.2
NEW FEATURES

ergmMPLE
can now output an array of change scores associated with each dyad. See the help page for more details.
BUG FIXES
Some MetropolisHastings proposal functions would sometimes return incorrect acceptance probabilities when combined with the
bd
constraint. This has been fixed.In
simulate.ergm
andsimulate.formula
, some combinations ofcontrol$parallel
,statsonly
, andsequential
arguments would cause an error. This has been fixed. Note that the current implementation of parallel simulation whenstatsonly=FALSE
orsequential=FALSE
is very inefficient.A namespace bug in the likelihod calculation code, reported by Matthew Hoover, has been fixed.
MPLE for some degreebased constraints has been reenabled.
DEPRECATED & DEFUNCT
Argument
fitmodel
toergmMPLE
has been deprecated in favor ofoutput
.
OTHER USERVISIBLE CHANGES
Default
SAN.burnin
control parameter has been increased to 100,000.
Changes in version 3.1.1
BUG FIXES
Longstanding bugs in MCMC standard error calculation have been fixed. In particular, MCMC standard errors are now calculated for offset models, and they are no longer overestimated (by too much).

san
now behaves sensibly when the network exceeds the number of edges allocated. 
degrange
terms now initialize correctly for their respective network types. Some spurious warnings are no longer printed.
A variety of minor errors has been fixed.
OTHER USERVISIBLE CHANGES

ergm
's implementation and tests now work withnetwork
version 1.8. (In particular,bipartite=0
is now treated as a network with no actors.)
Changes in version 3.1
NEW FEATURES
Infrastructure has been added for fitting valued ERGMs of Krivitsky (2012). The “user interface” is subject to change, however. (The implementation of reference measures for counts can be found in R package
ergm.count
)
ergm
itself now includes rudimentary implementations for discrete uniform and continuous uniform reference measures. Seehelp('ergmreferences')
. A large number of ERGM terms for counts have been implemented and documented. See
help('ergmterms')
.A number of new binary ERGM terms have been implemented as well. Particularly,
degrange
,odegrange
,idegrange
,b1degrange
, andb2degrange
, which generalizedegree
andconcurrent
by allowing the user to specify contiguous ranges of degree values.A rudimentary “degeneracy” heuristic has been implemented and enabled by default, immediately stopping MC MLE optimization if simulating from a parameter configuration of interest encounters produces networks with too many edges. See
MCMLE.density.guard
argument incontrol.ergm
documentation for details. Note that this is intended mainly to keep the fitting from bogging down on bad models, and it should not be used as a formal degeneracy diagnostic.
ergm
now keeps track of of when it is and when it's not possible to evaluate the likelihood of the null model (a model with no terms), and takes into account whether a model is constrained, has missing dyads, etc.. This can also improve the MPLE.A new generic,
logLikNull
has been added that returns the null model likelihood.For models where this is not possible, the null likelihood (and deviance, etc.) is defined to be 0.
A new constraint,
blockdiag
has been added, for modeling networks with only withinblock ties allowed. This is useful for, e.g., fitting an ERGM to several networks jointly. See? 'ergmconstraints'
for available constraints.
OTHER USERVISIBLE CHANGES
The implementation of dynamic network models has been moved to a new package,
tergm
.Sample space constraints
degrees
,idegrees
,odegrees
,b1degrees
,b2degrees
have been reimplemented or fixed.Certain functions are now only exported if they haven't already been defined (e.g., by
latentnet
).Documentation and citation information have been cleaned up and reorganized. In particular, see
? 'ergmconstraints'
,? 'ergmterms'
for an article on terms, and? 'ergmreferences'
for reference measures implemented.
CLEVEL FACILITIES

ergm
now exports header and stub files for theLinkingTo:
API, and packageergm.userterms
now uses it. Please seeinst/include/README
before using it, however.
DEPRECATED & DEFUNCT
Dynamic network modeling code has been moved to
tergm
package.Function
statnet.edit
has been removed.
BUG FIXES
Some bugs introduced by the developers relying on a certain behavior of the
.C
API which had changed have been fixed.Some undocumented terms have been fixed and documented, including
odegreepopularity
,idegreepopularity
,degreepopularity
, andsmalldiff
.
Changes in version 3.0
NEW FEATURES
Facilities for fitting and simulating Separable Temporal ERGMs (STERGMs) of Krivitsky (2009) and, Krivitsky and Handcock (2010) have been added. See
stergm
andsimulate
.
ergm
MCMLE will now test if the optimization has converged to the MLE and stop if it detects convergence. 
ergm
Now checks if a constraint specified in theconstraints
argument fixes any statistics in the model (e.g.,ergm(y~edges, constraints=~edges)
). It issues a warning, and fixes their parameters at 0. 
simulate
functions now take an argumentmonitor
, a onesided formula for additional statistics to be returned. This allows one to easily simulate from anergm
orstergm
fit statistics that were not in the fitted model. 
ergm
can now optionally detect when a burnin is insufficient and retry it until it is sufficient. Seecontrol.ergm
argumentMCMC.burnin.retries
for details. 
ergm
MCMLE now stores “history” of\theta
and simulated statistics. 
ergm
extreme statistics detection (ifcontrol.ergm(drop=TRUE)
) can now detect both extremely high and extremely low values, setting the coefficients to +Inf and Inf respectively. Direction of “dropping” is returned. An initial method
"zeros"
has been, to use a vector of zeros as starting parameters.A number of new ERGM terms have been added.
OTHER USERVISIBLE CHANGES

ergm
,simulate
, and other functions now enforce a conceptual separation between what to fit, which is controlled by arguments to the function and how to fit it, which is controlled by thecontrol
lists, generated bycontrol.ergm
andcontrol.simulate
, respectively. (Old arguments forergm
andsimulate
still work with a warning, and they may be removed later.) The data structure returned by
simulate
is now a list of networks withattr
style attributes describing how it was generated. The list has print and summary methods, and it can be used in the lefthand side of asummary
formula.Matrices of sample statistics returned by
ergm
aremcmc
objects (ormcmc.list
objects, for parallel computing).Arguments
theta
have been renamed tocoef
. Argumentsmeanstats
have been renamed totarget.stats
. Many control parameters have also been renamed and reorganized. (Old parameters still work with a warning, and they may be removed later.)A number of arguments to
control.ergm
,control.simulate
, and others, have been renamed.
ergm
now uses bridge sampling evaluate the loglikelihood by default. (Before, the default was to not evaluate it.) 
mcmc.diagnostics
has been rewritten:RafteryLewis diagnostic has been replaced with several others, including tests of (non)convergence.
For fits with missing data, diagnostics for both the constrained and the unconstrained sample are printed and plotted.
Plots now use
lattice
graphics, if available.
Handling of networks with many edges has been improved somewhat.

gof.ergm
andgof.formula
now set the statistics used to diagnose the fit adaptively, depending on the directedness of the network being modeled.
DEPRECATED & DEFUNCT
The following control parameters have been removed or renamed:
maxedges
,prop.weights
,prop.args
,packagename
,summarizestats
,nr.maxit
,nr.reltol
,maxNumDyadTypes
,steplength
,initialfit
,style
,obs.MCMCsamplesize
,obs.interval
,obs.burnin
,compress
,metric
,force.mcmc
,adaptive.trustregion
,adaptive.epsilon
,mcmc.precision
,method
,MPLEtype
,check.degeneracy
,maxMPLEsamplesize
,MPLEsamplesize
,phase1_n
,nsubphases
,RobMon.phase1n_base
,RobMon.phase2n_base
,RobMon.phase2sub
,RobMon.init_gain
,RobMon.phase3n
,trustregion
,stepMCMCsize
,steppingmaxit
,gridsize
,sequential
,returnMCMCstats
,calc.mcmc.se
,hessian
,prop.weights
,prop.args
, andpackagenames
.The following arguments to functions have been moved to the corresponding control functions, removed or renamed:
burnin
,MCMCsamplesize
,interval
,maxit
,seed
, andtheta0
.
BUG FIXES
Fixed some errors in loglikelihood calculation, especially in models with missing data and/or offset terms.
Parallel processing has been made more robust. In particular,
ergm
now checks to make sure that the version it finds on slave nodes is the same as the version on the master. Also, althoughergm
will start its own cluster as needed, it will also detect if an MPI cluster has already been started and use that.Several bugs relating to handling models with with offset terms have been fixed.
The bounded degree (
bd
) ERGM would sometimes tabulate degrees incorrectly. This has been fixed.Miscellaneous robustification and bug fixes.
Changes in version 2.4
NEW FEATURES
The “news” feature has been implemented. Type
news(package="ergm")
to see the version's updates.A function
ergm.allstats
was added to calculate all possible network statistics for a given ERGM and network. The number of possible networks grows on the order of2^{n^2}
, so this should only be used for small networks. Related functionergm.exact
calculates exact loglikelihood for a particular canonical parameter and a particular ergm.A
cutoff
argument has been added to specify maximum shared partner count or degree to be evaluated to the following model terms:gwb1degree
,gwb2degree
,gwdegree
,gwdsp
,gwesp
,gwidegree
,gwnsp
,gwodegree
. This significantly speeds up fitting curved ERGMs on large, sparse networks.The
logLik
method forergm
objects, with the attendantAIC
andBIC
methods, has been implemented.Calculation of loglikelihoods for MCMCbased ergm fits has been reengineered to use bridge sampling for dyaddependent models. (See
logLik.ergm
,ergm.bridge.llr
, andergm.bridge.dindstart.llk
.)A generic function
is.dyad.independent
to test whether an ERGM fit or formula is dyadindependent has been added.A generic function
fix.curved
to convert curved exponential family models to variants in which the curved parameters are fixed has been added. See the function documentation for usage scenarios.A generic function
enformulate
function to work around a current limitation in theergm
function to substitute curved parameters from a model fit into the model formula, allowing them to be used as initial values (thetheta0
argument). See the function documentation for usage scenarios.The following new models terms have been added:
degcrossprod
anddegcor
.Tests for change statistics have been added.
A new dataset has been added:
kapferer
, the wellknown tailor shop network dataset of Kapferer (1972).
OTHER USERVISIBLE CHANGES
The package has been “standardized” to represent directed ties as
(tail,head)
.
BUG FIXES
Loglikelihood calculation for dyaddependent models has been fixed.
Some errors in estimating parameters in curved exponential family models have been fixed.

gof
now automatically selects the right goodnessoffit statistics for the network type (directed vs. undirected) given. Bug in is.inCH in 2.42 fixed in 2.43.
DEPRECATED & DEFUNCT

as.directed
function has been removed. All model terms included in the package have been reimplemented using the new
InitErgmTerm
framework.