Last chance! 50% off unlimited learning
Sale ends in
ergm
is used to fit linear exponential
random graph models, in which
the probability of a given network, $y$, on a set of nodes is
$\exp{\theta{\cdot}g(y)}/c(\theta)$, where
$g(y)$ is a vector of network statistics for $y$,
$\theta$ is a parameter vector of the same
length and $c(\theta)$ is the
normalizing constant for the distribution. The network statistics $g(y)$ are entered as terms in the
function call to ergm
.
This page describes the possible terms (and hence network statistics).
ergm
are specified by a formula to represent the network and
network statistics. This is done via a formula
, that is,
an Rformula object, of the form
y ~ + ...
,
where y
is a network object or a matrix that can be coerced to a
network
object, and
,
, etc, are each terms chosen
from the list given below.
To create a network object in R, use the network
function,
then add nodal attributes to it using the %v%
operator if necessary.ergm(flomarriage ~ kstar(1:2) + absdiff("wealth") + triangle)
ergm(molecule ~ edges + kstar(2:3) + triangle
+ nodematch("atomic type",diff=TRUE)
+ triangle + absdiff("atomic type"))
Run the code above in your browser using DataLab