A new hint triadic
and associated proposal SPDyads
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 with sparse
).
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 has fixed.dyads=
as its first argument, and if present=
or absent=
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 passing MPLE.check=FALSE
to control.ergm()
. Auxiliary calls to MPLE do so by default.
A number of improvements to ergm.allstats()
and ergm.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 dyad-independent constraints.
Excessive runtime check now works in terms of free dyad counts rather than network sizes.
ergm.godfather()
now takes a basis=
argument like ergm()
, simulate.ergm()
, and others. Its term options can be passed directly as well.
COLLAPSE_SMALLEST
was selecting incorrect categories under some circumstances.
blockdiag
constraint initialization now detects when blocks are non-contiguous and stops with an error. (Previously, it would behave in undefined ways.)
Sum
operator now handles I()
label specifications correctly; this also fixes an error in the Prod
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 dyad-dependent statistics).
In control.ergm()
, MCMC.prop=
is now passed through to SAN.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 and monitor=
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 dyad-dependent, since inserting edges may break the constraint.
edgecov()
and dyadcov()
now handle network
-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 non-confidence 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 for mm()
no longer causes memory errors.
Valued proposal updater function was not being passed the current edge state.
Undefined behavior warnings flagged by CRAN's clang-asan
have been fixed.
A number of utilities, including sginv
and xTAx_seigen
have been moved to statnet.common.
LARGEST
, SMALLEST
, and COLLAPSE_SMALLEST
now break ties lexicographically with a warning.
absdiffcat
is now more memory-efficient 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 its namewrap=
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()
, and ergm_Init_message()
that behave more like their base counterparts have been added to the API. ergm_Init_abort()
, ergm_Init_warn()
, and ergm_Init_info()
will eventually change to use their rlang semantics.
edgecov()
and dyadcov()
now check that their covariate matrix has the correct dimension.
Constraints fixedas()
and fixallbut()
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 specifying levels2=
levels by value.
Miscellaneous documentation fixes.
param_names()
API now allows assignment, and its method for ergm_model
objects is more explicit about whether canonical or curved parameters are being modified and when.
ergm_model()
constructor is now generic, with methods for formula
, term_list
, and ergm_model
.
is.dyad.independent()
can now return dyadic-independence 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.
The khash
C API now uses an enum
type for insertion status.
The dyad hash edgelist API has been improved, in particular with guarding against double-insertions 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 the directed
argument. Instead, it expects that any dyads passed to it be appropriately sorted.
Calls to Calloc()
, Realloc()
, and Free()
have been replaced with their R_
-prefixed counterparts.
khash
no longer allows allocators to be specified via macros; they are now hardcoded to use those from R.
Non-API SET_TYPEOF()
is no longer used.
UnsrtEL
and HashEL
now have, respectively, UnsrtELSize()
and HashELSize()
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 exports FirstRLEBDM1D()
and LastRLEBDM1D()
macros, providing dyad indices of the first and the last dyad in the RLEBDM, respectively.
ChangeStats()
function has been split into ChangeStatsDo()
and ChangeStatsUndo()
, 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.
edges
constraint can now be combined with arbitrary dyadic constraints.
Syntactic fixes in documentation.
The bounded degree support in the dyad noise proposal (see dyadnoise-ergmConstraint
) has been fixed.
Fixed a bug in the DyadGen API implementation that would sometimes cause a crash when sampling non-edges 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.
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()
with observational=TRUE
, the basis (initial network) defaults to object$network
, not object$newnetwork
, since the latter often has missing edges and other metadata missing.
Documentation for defunct functions (in ergm-defunct
) no longer includes function prototypes as they triggered CRAN warnings.
Some changes to minimize matrix inversions and improve numerical stability.
New C macros to simplify initialization of the standard dyad generator and bounded degree sampler.
as.network.numeric()
no longer constructs n\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 full network
objects.
MPLE estimation can now provide improved standard errors via bootstrap or Godambe estimation. (Thanks to Christian Schmid.)
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 the ergm()
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.
Optimizations to various directed shared partner calculations.
gw*sp()
and dgw*sp()
terms are now just aliases of each other.
In dgw*sp()
terms, cutoff=
argument is not meaningful when fixed==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.
Some helper functions for printing vectors and matrices in ergm_util.c
have been improved.
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()
, and simulate.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 post-processing and diagnostics that was previously extracted from them is now stored in the $info
element.
ergm()
now takes a newnetwork=
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()
's MCMC.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)
and anyNA(ergm)
methods can now be used to test if an ERGM was fit a missing data or observational process.
mcmc.diagnostics()
now has a compact=
argument, to optionally abbreviate statistic and/or parameter names for more compact display.
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.
In the simulate()
, passing theta0=
is now an error.
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 Win-Builder): 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.)
New functions search.ergmHints()
and search.ergmReferences()
can now be used to search available ergmHints
and ergmReferences
, 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 post-4.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, provided basis=
argument is supplied and is a network.
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 goodness-of-fit 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.
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 the constraints=
formula includes a -.
(minus dot) term. The former behaviour was to inherit only if constraints=
argument had a .
.
Some constraints' implementations are now much more memory-efficient.
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 Robbins-Monro 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 of shrink_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 an ergm_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.
Some useful dynamic node and edge list data structures added and exported.
Packages tergm, networkDynamic, and latentnet are no longer Suggested to simplify testing.
In terms edgecov()
and dyadcov()
, the argument can now be a network.
Fixes to estimation for valued ERGMs with missing data.
Retrying and other robustification to lpSolve-based 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 R base
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., non-ergm
objects) now produces an informative error message.
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 the simulate_formula
method for network
objects can call it directly.
In ergm()
, the LHS no longer needs to be a network object, as long as basis=
is provided.
anova.ergm()
documentation no longer discusses test statistics (which were never implemented in the first place).
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.
More ergmKeyword
s have been added for dyadic and triadic covariates, and terms have been tagged appropriately.
Robustification of step length calculation, documentation processing, numerical optimization, and elsewhere.
Minor documentation and vignettes fixes and clarifications.
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.
A new framework for documenting and cross-referencing ERGM terms and term-like 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 function-like documentation entry, e.g., edges-ergmTerm
, edges-ergmConstraint
, sparse-ergmHint
, Unif-ergmReference
, and TNT-ergmProposal
, which can be invoked with ergmTerm?edges
etc.. Visible terms are dynamically indexed in ergmTerm
, ergmConstraint
, ergmHint
, ergmReference
, and ergmProposal
. (Joyce Cheng)
Indexing can be done by keyword (using R's concepts), whose meanings can be looked up in ergmKeyword
. Terms cane be searched via search.ergmTerms
, search.ergmConstraints
, etc.. (Joyce Cheng)
Term nodemix
can now be passed a levels2
argument that is a factor
or character
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
and ergm_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.
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 dyad-dependent and stops with an error.
fixallbut
constraint now works for matrix input.
The "confidence"
convergence criterion is now more robust to nonidentifiable models.
edgecov
and dyadcov
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 where as.matrix.network
was called directly.
gof.ergm
now handles missing data networks more or less correctly again.
Log-likelihood 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)
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 low-discrepancy 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 the Stepping
algorithms have been deprecated (the latter in favour of MCMLE
).
Adaptive MCMC's burn-in detection now models the burning in as exponential decay to the stationary distribution, and selects burn-in based on a given amount of bias due to burning in.
approx.hotelling.diff.test
with var.equal=TRUE
now uses a pooled estimate of autocovariance, so spectrum0.mvar
is only called once.
MPLE estimation now returns the Hessian as well. (Previously, it was only MCMC-based methods that did.)
ergmMPLE
no longer has the fitmodel=
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
, and offset()
decorator is set on each term's coef.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 of edgecov-ergmTerm
and dyadcov-ergmTerm
effects.
main.method="Robbins-Monro"
implementation is broken and has been disabled pending either fixing in the next release or removal. (There is nothing it can do that "Stochastic-Approimation"
doesn't do better.
Term hamming-ergmConstraint
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 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.
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 to TRUE
for backwards compatibility, though this may change in the future.
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 is NULL
. For backwards compatibility, the check is skipped if the argument is optional and the default value is NULL
. A constant ERGM_VATTR_SPEC_NULL
has been added for when NULL
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 clean-ups.
A number of memory leaks have been fixed.
Miscellaneous improvements to the BDStrat*
family of proposals.
In adaptive MCMC, burn-in detection now fits an exponential decay rather than a broken stick model.
Fixes to extended state API propagation in Passthrough
term.
Fixes to the handling, particularly of curved terms and offsets, in the Sum()
and Offset()
operators.
Minor fixes and improvements to some terms' C implementations.
Per request of the sna maintainer, symmetrize()
generic and methods have been renamed to ergm_symmetrize
.
Metadata set by %ergmlhs%
is now pretty-printed.
In the C API, the ToggleKnownEdge()
, function now ensures that tail < head for undirected networks.
Terms, such as nodecov
, that take matrix-valued functions of nodal attributes now generate coefficient names from the matrix column names more sensibly.
The levels2
argument in terms mm
and nodemix
now accepts an argument in the form of a logical mixing matrix, selecting which mixing matrix cells should be included.
ergmMPLE()
now has an expand.bipartite=
argument, which, for output='array'
, controls whether bipartite networks' adjacency matrices are represented as rectangular or as square. Other behaviors under output='array'
have also been made more consistent.
In gof
functions, bipartite networks now have their own goodness-of-fit statistics, b1degree
and b2degree
.
Formula or function-type nodal attribute specifications can now be more complex. In particular, magrittr-package
's %>%
operator can now be used on one of the sides of an mm
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=
and init=
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 dyad-independent effects (TERM1:TERM2
and TERM1*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
and cyclicalties
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 CTRL-C) even from inside the C code.
update.network
can now update the network using a variety of inputs, including edgelists and ergm_state
s.
The MPLE initial method can now be used to estimate curved ERGMs without specifying the initial curved parameter. The initialfit=
InitErgmTerm
argument and as.initialfit=
argument of ergmMPLE
have been removed. Similarly, fix.curved
and enformulate.curved
have been deprecated and may be removed in a future release.
A mechanism for specifying “observational constraints” (obs.constraints
)
has been added to ergm
, 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 the egocentric
constraint.
An argument observational=
to simulate.ergm
can specify whether the model or the observational constraint from the ergm
fit should be used.
The user can now specify “hints” on a formula to MCMC.prop=
and obs.MCMC.prop=
arguments passed to control.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), and strat
, 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 block-level stratification among the dyads.
A number of model specification settings, including constraints
, obs.constraints
, and response
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. (Terms nodesqrtcovar
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
(for control.ergm
and control.simulate.ergm
) is retained (with an infinite default) to be used to short-circuit a sampler that has gone degenerate.
The "Stochastic-Approxmation"
algorithm (a C-based implementation of Robbins-Monro) now fully supports curved ERGMs.
The control.ergm
parameters for "Stochastic-Approximation"
and "Robbins-Monro"
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, and parallel.inherit.MT=
argument of control.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 a rlang
-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 parameter MCMC.scale
can now be used to set the MCMC burn-in and interval relative to those of the ergm
fit.
In ergm
formulas, the offset()
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 lack-of-fit diagnostic rank_test.ergm
has been added.
The sna function symmetrize
is made into a generic and a method for network
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 source-compatible with the previous versions.
The R API for ergm_model
takes an additional argument extra.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.
Log-likelihood estimates and derived quantities (deviance, AIC, BIC) now also report their standard errors due to bridge sampling. Setting the bridge.target.se
control option to control.logLik.ergm
and/or control.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.
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 Yu-Lun 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
, and dgwnsp
, 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.
IMPORTANT: The levels2=
argument of nodemix
and mm
terms now defaults to -1
(i.e., exclude the first level combination). Old behaviour is available through the version
term option.
IMPORTANT: In curved terms such as gwesp
(with fixed=FALSE
), the decay parameter in the term is now ignored; the initial decay parameter must be specified as a part of control.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 the basis=
argument if present, with the formula being allowed to be one-sided.
In control.ergm
, arguments SAN.control=
and loglik.control=
have been shortened to SAN=
and loglik=
, 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 lpSolveAPI-package
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 by ergmfit$coefficients
for consistency with glm
and others. The former still works, with a deprecation warning. Using coef(ergmfit)
is recommended.
Arguments to ergm_MCMC_sample
and ergm_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 option cache.sp
.
The term API now supports box constraints on parameters or
coefficients, which may be set via minpar
and
maxpar
elements in the InitErgmTerm
'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
parameter MPLE.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 via obs.MCMC.mul
.
A variety of improvements and tuning parameters for the Hummel step length algorithm (control.ergm
parameters MCMLE.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 burn-in 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 the ergm_state
API that uses the .Call
interface.
simulate.ergm
now has not just the ergm_model
methods but also ergm_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 in ergm
.
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
and InitErgmReference
API now has the same calling convention as Init*ErgmTerm
, which enables check.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 the simulate.ergm
family of functions has been deprecated in favor of a more consistent return.args=
.
Likelihood-change trust region (trustregion
) code has been removed.
Almost all of the R-C interface has been transition to use the .Call
rather than the .C
API. Some helper functions are provided in inst/include/ergm_Rutils.h
.
Functions ergm.eta
, ergm.etagrad
, and ergm.etagradmult
have been reimplemented in C using the .Call
interface. They are available in the C API in inst/include/ergm_etamap.h
.
inst/include/ergm_changestat.h
and inst/include/ergm_wtchangestat.h
now provide more helpful helper macros.
InitErgmTerm
and InitErgmProposal
functions can now pass a integer
(as opposed to a numeric
) vector to the C functions with an outlist$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, for O(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 by ergm_dyadgen_select
automatically selects sampling arbitrary dyads, sampling from an edgelist, or sampling from an RLEBDM. It obviates a number of other proposals, such as RLETNT
and listTNT
.
All header files exported by ergm have been prefixed with ergm_
. (Old header file names now issue deprecation warnings.)
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 case-control likelihood using the MPLE.samplesize
control parameter (if initial fit is final) and by the init.MPLE.samplesize
control parameter (if it is used only to initialize the MCMC-based estimation).
A new “operator” constraint Dyads
takes ergm
formulas and constrains dyads based on which dyads affect their change statistics.
It is now possible to calculate model-predicted conditional and unconditional tie probabilities using predict.ergm
and predict.formula
. (Contributed by Michal Bojanowski.)
The nodal attribute specification mechamism (i.e., the attr=
and levels=
arguments to terms) now includes a number of convenience functions and predicates, such as LARGEST
and SMALLEST
to select or exclude the most/least frequent levels, and COLLAPSE_SMALLEST
to collapse the smallest categories into one.
ergmMPLE
now takes a constraints
argument and handles it and missing dyads correctly.
san
now has the ability to take offsets into account.
mcmc.diagnostics.ergm
now takes an argument which=
to to specify which output is wanted.
The following new model terms have been implemented:
b1dsp
, b2dsp
, gwb1dsp
, and gwb1dsp
, the bipartite versions of dsp
and gwdsp
.
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 a basis=
argument as others.
plot.gof
now plots a blue rhombus to indicate the simulated mean.
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 in san
.
Fixed the documentation for the object
argument to ergm_proposal
, and fixed a recursive default argument to ergm_proposal.character
.
Added a workaround for a limitation of coda::densityplot.mcmc.list
when variable names are not unique, which caused a problem in mcmc.diagnostics
pointed out by James Wells.
The levels
argument was removed from starmix
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 to data=sys.parent()
anymore.
as.network.numeric
now handles the bip
argument consistently with network.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 burn-in. (This bug did not invalidate any prior results, but it made the log-likelihoods and derived quantities reported by summary.ergm
less accurate.)
ergmMPLE
now handles offsets corectly when returning matrix and array output.
Miscellaneous fixes to predict.ergm
and ergmMPLE
, particularly in handling offsets.
Miscellaneous vignette and documentation fixes.
Datasets fauxhigh
and fauxhigh.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 call simulate()
on an ergm_model
object without reinitializing it.
A number of improvements have been made to the nodal attribute API. In particular, ergm_get_vattr
now has an AsIs
method that makes minimal changes to the input before returning, ergm_get_vattr.function
now propagates its arguments to the function it calls, and ergm_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's check.ErgmTerm
now accepts NA
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
, and newnw.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, particularly lme4
. The simulate_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.
C export ergm_constants.h
now exports the major and the minor version of ergm
.
Deprecated term argument warnings are now only printed once per session.
mcparallel
antiwarnings are now printed less frequently.
ergm
version 3.10.1 inadvertently depended on R 3.6. The dependence has been reverted to 3.5.
In all gw*
terms, the cutoff=
argument can now be controlled by a gw.cutoff
term option.
nobs
method has now been implemented for ergm
objects.
simulate.ergm
now takes a basis=
argument (defaulting to NULL) that it passes to simulate.formula().
ergm.godfather
now takes an additional changes.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
and enformulate.curved
now handle the dgw*sp
terms.
simulate.ergm
and others now have an output=
argument to provide finer control over the return format. It is to be preferred over the statsonly=
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
and b*cov
can now take multiple quantitative attributes or a function that returns a quantitative attribute matrix and produce a statistic for each.
Terms b1sociality
and b2sociality
have been added.
MCMLE estimation method can now checkpoint and resume optimization. See control.ergm
's MCMLE.checkpoint=
and MCMLE.resume=
arguments.
A variety of documentation expansions, cleanup, and other improvements.
The default method of ergm.stopCluster
had not
been exported.
summary.ergm
fixed for CD estimation.
diff
term with sign.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 a summary.ergm
on a object produced by an earlier version.
Disambiguation help pages have been added for concepts (such as edges
and hamming
) 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.)
Low-level function ergm_SAN_slave
has now been split out of san
like ergm_MCMC_slave
.
Lower-level simulate.ergm_model
and san.ergm_model
have been split out of simulate.formula
and san.formula
.
gof.ergm
now uses a longer MCMC.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 semi-internal pending_udpate_network
API can be used to carry around network information between .C
calls without having to reconstruct the network.
control.ergm
's init.method=
argument now overrides the candidate list when selecting initialization methods.
network.update
is deprecated in favor of an update.network
method.
standardize.network
has been deprecated, rendered obsolite by improvements to the network
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 an attr(,"monitored")
to the returned statistics, indicating which statistics were generated from the monitor=
argument.
pending_update_network
“API” is more formalized now, including methods overriding those of network
.
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 by options(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 arguments attrname
and levels
have been deprecated.
Most parallel calls are now a little bit more fault-tolerant, retrying on error.
Chad Klumb has been added as a contributor to the package.
Some changes to the Metropolis-Hastings proposal API.
Network initialization functions now return a pointer, and destroying functions free it.
Miscellaneous improvements to low-level C code. In particular, more of the code now runs deterministically.
Improvements to encapsulation of Network
structures.
A new API allows arbitrary combinations of dyad-level 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 the
ergm
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.
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 Robbins-Monro 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.
The coefficient names associated with terms enclosed in
offset()
are now also enclosed in offset()
.
summary
method for ergm
now
uses uses z
-tests rather than t
-tests, since there
is no “dispersion” parameter. In addition, it no longer
takes a digits=
argument.
Handling of missing relations has been improved.
Estimation progress when verbose=TRUE
is now a bit less
verbose; use verbose=2
and up to get more information.
The default value of the eval.loglik=
argument to ergm
is now
controlled by options
option ergm.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_attributes-API for details.
summary
method for ergm
now exports a $coefficients
element (like
summary.lm
) and $devtable
is a proper table.
New generics nparam
and
param_names
can be used to query the number
and the names of the parameters in a model.
ergm_model
(replacing
ergm.getmodel
) is now a full-fledged S3 class,
representing initialized ergm
models. See its help for the
major methods. In particular, ergm.getglobalstats
has
been repalced with summary.ergm_model
.
simulate.formula
functions now take an
ergm_model
as an argument to monitor=
.
Constraint initializers have been renamed from
InitConstraint
to InitErgmConstraint
. The
constraint implications table has been replaced with
implies
and impliedby
constraint lists.
Proposal initializers have been renamed from
InitMHP
(and InitWtMHP
) to
InitErgmProposal
(and
InitWtErgmProposal
). ergm.MHP.table
has been renamed
to ergm_proposal_table
.
Reference initializers have been renamed from
InitReference
to InitErgmReference
. Return
format has also been changed, replacing
ergm.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 the
to_ergm_Cdouble
generic.
ergm.getMCMCsample
and ergm.mcmcslave
have
been renamed to ergm_MCMC_sample
and
ergm_MCMC_slave
respectively, and the arguments of
ergm_MCMC_sample
have been made more user-friendly.
Development of ergm
and associated packages is now hosted
on GitHub.
Some terms, particularly dyadcov
have been improved.
Bug fixes to contrastive divergence code.
ddsp
and dnsp
terms now work
correctly for 0 shared partners. (Thanks to Wouter Spekkink for
reporting this bug.)
Miscellaneous bug fixes, typo corrections, and robustifications.
Terms degreepopularity
, idegreepopularity
, and
odegreepopularity
have been renamed to degree1.5
,
idegree1.5
, and odegree1.5
respectively.
Progress reports for ERGM fits and simulations are now printed
using message
, so they can be suppressed with
suppressMessages
.
A number of functions deprecated in 2015 have been removed. See
help('ergm-defunct')
for the list.
Reverted a non-portable use of C function
alloca()
. (Thanks to Prof. Brian Ripley for pointing out
the problem.)
New term diff
, a directed analogue to
absdiff
has been added, allowing for different
ways to handle differences in nodal attributes.
By default, gof
now checks goodness-of-fit
with respect to the estimated model in addition to the specified
terms. This can be used to diagnose convergence.
Terms concurrent
, degree
,
degrange
, and concurrentties
“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 step-length code.
The geometric decay parameter in gw*sp
and
dgw*sp
terms has been renamed from alpha
to
decay
, for consistency with gw*degree
terms.
It is now explicitly an error to pass a control=
parameter to the function directly. (Previously, such
parameters were silently ignored.)
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
and
samplike
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 to system.time
.
Miscellaneous fixes to the documentation and robustifications.
A new suite of geometrically-weighted 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 non-edgewise shared
partners (dgwnsp
)
In addition, terms for specific shared partner counts
(ddsp
, desp
, and dnsp
)
have been implemented. See ergm-terms
for help.
New terms (binary and valued) b1cov
and b2cov
have
been implemented, analogous to nodecov
,
nodeicov
, and nodeocov
but for
bipatite networks.
New valued terms atleast
,
equalto
, and smallerthan
have
been implemented. A number of terms that were binary-only before
have been implemented for valued ERGMs.
ergm
package now works when loaded (e.g., using
requireNamespace
) but not attached (e.g., using
library
).
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.
robust.inverse
has been deprecated in favor
of ginv
.
simulate.formula
now does parallel processing
more efficiently.
Added a new generic, is.curved
that tests if a
given ERGM or model is curved.
Block-diagonal 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 log-likelihood at the MLE now prints out a brief progress report by default.
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 of threetrail
to more accurately reflect what is
being computed.
The "naive" log-likelihood ratio metric now handles offsets more robustly.
The null log-likelihood calculation prints messages instead of throwing warnings.
The closed-form solution (see Hummel et al., 2010) for the "lognormal" metric had been inadvertantly disabled. It has been reenabled.
Many documentation fixes and clarifications.
Skye Bender-deMoll 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
, and ergm.update.formula
have been
moved to the statnet.common
package.
The as.edgelist
family of functions have been moved
to the network
package.
mcmc.diagnostics.ergm
now takes the
esteq=
argument. If TRUE
, the diagnostics are
performed on the simulated values of the estimating functions. If
FALSE
, they are performed on simulated values of canonical
statistics. This obviates and replaces the the curved=
argument.
san
when used with curved models now requires
canonical statistics as targets.
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 edge-count) constraints. For binary networks with dyad-independent constraints, MPLE still generally works better and remains the default.
To obtain the contrastive divergence estimate, call
ergm
with estimate="CD"
.
Fixed issue where constraints was not appropriately compared to older version
Fixed bug where the deviance of dyad-independence models was incorrectly computed/reported for all models
Removed Rglpk
package dependency; replaced it with lpSolve
package dependency. See man page for is.inCH
for details
Fixed 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
ergm
with estimate="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.
CRAN-requested code structure changes (generally not visable to user):
require
and library
calls changed to requireNamespace
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 semi-stable API for use by developers of other ergm-related packages.
Many formerly undocumented 'internal' functions have been made internal by the NAMESPACE
. As far as we know, this avoids functions in use by reverse-Depending packages. These currently appear as commented items in the NAMESPACE
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.
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 of MCMLE.last.boost
Default values for a number of other control parameters have changed, see CHANGES below.
Parallel functionality: ergm can take user-created clusters as the parallel control parameter. This is the recommended method for using ergm on a high-performance computing cluster. See ergm-parallel. Functionality now implemented via the parallel
package, direct dependence on snow
package is removed
New helper function search.ergmTerms()
function which through the ergm.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 non-NULL to enable this functionality; 50 is a reasonable value. Includes new ergm.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 attribute-based 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 for simulate.formula
and simulate.ergm
: Default is FALSE. If TRUE, compute the sample estimating equations of an ERGM. If the model is linear, all non-offset 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 of tergm
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 with iGraph
MCMC control parameters changes in control.ergm
default for MCMC.interval
increased from 100 to 1000
default for MCMC.burnin
changed from 10000 to mcmc.interval*16
default 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 added
control parameter MCMCLE.steplength.margin
has been added
default value for MCMLE.MCMC.precision
has been increased from 0.05 to 0.005
default 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 for control.simulate
, control.simulate.formula
and control.simulate.formula.ergm
increased from 1000 to 10000
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 Penalized-likelihood 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 to logLik.ergm()
and ergm.bridge.dindstart.llk()
.
fixes issue reported by Sebastian Daza
Fixed a fencepost bug in ergm.bridge.dindstart.llk()
's construction of the offset coefficient vector in the dyad-independent submodel reported by Philip Leifeld
Adjusted 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...
The ergm control parameter MCMLE.method
has been deprecated. By default, ergm uses trust
, and falls back to optim
with Nelder-Mead method when trust
fails.
The ergm control parameter MCMLE.adaptive.epsilon
has been removed.
The ergm control parameters MCMC.burnin.retries
, MCMC.burnin.check.last
and MCMC.burnin.check.alpha
have been removed.
MCMLE.adaptive.epsilon
parameter has been removed
The faux.high
dataset was removed as it was identical to faux.mesa.high
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.
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 Metropolis-Hastings 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.
Calling ergm
, with estimate="MPLE"
for
a curved exponential family model (e.g., gwesp
with
fixed=FALSE
) is now an error. (Previously, it treated the
curved term as fixed, which was misleading.)
ergmMPLE
can now output an array of change
scores associated with each dyad. See the help page for more
details.
Some Metropolis-Hastings proposal functions would sometimes
return incorrect acceptance probabilities when combined with the
bd
constraint. This has been
fixed.
In simulate.ergm
and
simulate.formula
, some combinations of
control$parallel
, statsonly
, and sequential
arguments would cause an error. This has been fixed. Note that the
current implementation of parallel simulation when
statsonly=FALSE
or sequential=FALSE
is very
inefficient.
A namespace bug in the likelihod calculation code, reported by Matthew Hoover, has been fixed.
MPLE for some degree-based constraints has been reenabled.
Argument fitmodel
to ergmMPLE
has been
deprecated in favor of output
.
Default SAN.burnin
control parameter has been
increased to 100,000.
Long-standing 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.
ergm
's implementation and tests now work with
network
version 1.8. (In
particular, bipartite=0
is now treated as a network with no
actors.)
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. See help('ergm-references')
.
A large number of ERGM terms for counts have been
implemented and documented. See help('ergm-terms')
.
A number of new binary ERGM terms have been
implemented as well. Particularly, degrange
,
odegrange
, idegrange
,
b1degrange
, and b2degrange
, which
generalize degree
and concurrent
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 in control.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 within-block ties allowed. This is
useful for, e.g., fitting an ERGM to several networks jointly. See
? 'ergm-constraints'
for available constraints.
The implementation of dynamic network models has been moved to a
new package, tergm
.
Sample space constraints degrees
,
idegrees
, odegrees
,
b1degrees
, b2degrees
have
been re-implemented 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 ? 'ergm-constraints'
,
? 'ergm-terms'
for an article on terms, and ?
'ergm-references'
for reference measures implemented.
ergm
now exports header and
stub files for the LinkingTo:
API, and package
ergm.userterms
now uses it. Please see
inst/include/README
before using it, however.
Dynamic network modeling code has been moved to
tergm
package.
Function statnet.edit
has been removed.
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
,
and smalldiff
.
Facilities for fitting and simulating Separable Temporal
ERGMs (STERGMs) of Krivitsky (2009) and, Krivitsky and Handcock
(2010) have been added. See stergm
and
simulate
.
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
the constraints
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 argument
monitor
, a one-sided formula for additional statistics to
be returned. This allows one to easily simulate from an
ergm
or stergm
fit statistics that
were not in the fitted model.
ergm
can now optionally detect when a burn-in
is insufficient and retry it until it is sufficient. See
control.ergm
argument MCMC.burnin.retries
for
details.
ergm
MCMLE now stores “history” of
\theta
and simulated statistics.
ergm
extreme statistics detection (if
control.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.
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 the
control
lists, generated by control.ergm
and
control.simulate
, respectively. (Old arguments for
ergm
and simulate
still work with a warning, and
they may be removed later.)
The data structure returned by
simulate
is now a list of networks
with attr
-style attributes describing how it was
generated. The list has print and summary methods, and it can be
used in the left-hand side of a
summary
formula.
Matrices of sample statistics returned by ergm
are mcmc
objects (or
mcmc.list
objects, for parallel computing).
Arguments theta
have been renamed to
coef
. Arguments meanstats
have been renamed to
target.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
log-likelihood by default. (Before, the default was to not
evaluate it.)
mcmc.diagnostics
has been
rewritten:
Raftery-Lewis 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
and gof.formula
now set
the statistics used to diagnose the fit adaptively, depending on
the directedness of the network being modeled.
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
, and packagenames
.
The following arguments to functions have been moved to the
corresponding control functions, removed or renamed:
burnin
, MCMCsamplesize
, interval
,
maxit
, seed
, and theta0
.
Fixed some errors in log-likelihood 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, although ergm
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.
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 of 2^{n^2}
, so this should only be used for small networks. Related function ergm.exact
calculates exact log-likelihood 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 for
ergm
objects, with the attendant AIC
and BIC
methods, has been implemented.
Calculation of loglikelihoods for MCMC-based ergm fits has
been reengineered to use bridge sampling for dyad-dependent
models. (See logLik.ergm
,
ergm.bridge.llr
, and
ergm.bridge.dindstart.llk
.)
A generic function is.dyad.independent
to test
whether an ERGM fit or formula is dyad-independent 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 the ergm
function to substitute curved parameters from a model fit into the
model formula, allowing them to be used as initial values (the
theta0
argument). See the function documentation for usage
scenarios.
The following new models terms have been added:
degcrossprod
and degcor
.
Tests for change statistics have been added.
A new dataset has been added: kapferer
, the well-known
tailor shop network dataset of Kapferer (1972).
The package has been “standardized” to represent
directed ties as (tail,head)
.
Log-likelihood calculation for dyad-dependent models has been fixed.
Some errors in estimating parameters in curved exponential family models have been fixed.
gof
now automatically selects the
right goodness-of-fit statistics for the network type (directed
vs. undirected) given.
Bug in is.inCH in 2.4-2 fixed in 2.4-3.
as.directed
function has been removed.
All model terms included in the package have been
reimplemented using the new InitErgmTerm
framework.