ergm.userterms-package | R Documentation |
This non-CRAN package contains template code for user defined (change) statistics that can be used with the statnet suite of packages (and ergm in particular). To use this package the statnet packages ergm and network are required.
As background, statnet is a suite of software packages for statistical
network analysis. The packages implement recent advances in network modeling
based on exponential-family random graph models (ERGM). The components of
the package provide a comprehensive framework for ERGM-based network
modeling: tools for model estimation, for model evaluation, for model-based
network simulation, and for network visualization. This broad functionality
is powered by a central Markov chain Monte Carlo (MCMC) algorithm. The
coding is optimized for speed and robustness. For detailed information on
how to download and install the software, go to the ergm
website: statnet.org. A tutorial, support newsgroup, references and
links to further resources are provided there.
We have invested a lot of time and effort in creating the statnet
suite of packages for use by other researchers. Please cite it in all papers
where it is used.
For complete citation information, use
citation(package="ergm")
.
The statnet
suite of packages allows the user to explore a large number of potential
models for their network data. These can be seen by typing
?ergmTerm
(once the package ergm has
been installed). For more information on the models and terms see Morris,
Handcock, and Hunter (2008).
The purpose of the package is to allow additional terms can be coded up by users (you!) and be used at native speeds with statnet. So the suite of packages can be extended with minimal work by the user. In addition the core packages are not altered and so the new packages benefit from improvements to the core suite.
The process of creating new terms is explained in depth by the document entitled by Hunter, Goodreau, and Handcock (2013) that is found in the ‘inst/doc’ directory of this package. While that article is still valid, API changes in ergm 4.0 have simplified the term implementations and added new capabilities; see the Terms API vignette in ergm.
In brief, to add a new term you need to (all file references are relative to the package directory):
Download the source version of this package, currently hosted at https://github.com/statnet/ergm.userterms, e.g., https://github.com/statnet/ergm.userterms/archive/refs/heads/master.zip.
Unpack the source into a directory.
Optionally, rename the package name from ergm.userterms
to some
something more evocative of its use (e.g., myergm
). This can be done
using a global change to the files in the directory. Optionally, edit the
‘DESCRIPTION’ file to reflect the use of the package.
Edit ‘R/InitErgmTerm.users.R’ to add R InitErgmTerm
functions for the new terms.
Edit ‘src/changestats.users.c’ to add C
functions (like the
example already in that file) to compute the new change statistics.
Compile the package using the usual R tools (e.g., R CMD build
myergm
and R CMD INSTALL myergm
).
Run it! It depends on ergm and network, of course. See the example below.
Maintainer: Pavel N. Krivitsky pavel@statnet.org (ORCID)
Authors:
Mark S. Handcock handcock@stat.ucla.edu
David R. Hunter dhunter@stat.psu.edu
Carter T. Butts buttsc@uci.edu
Steven M. Goodreau goodreau@u.washington.edu
Martina Morris morrism@u.washington.edu
Hunter DR, Goodreau SM, Handcock MS (2013). ergm.userterms
: A
Template Package for Extending statnet
, Journal of Statistical
Software 52(2), 1-25, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v052.i02")}.
ergm-package, network-package, ergmTerm
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.