.spcache.net-ergmAuxiliary {ergm} | R Documentation |
Shared Partner Cache
Description
This auxiliary maintains a hash table mapping dyads to shared partner counts.
Usage
# binary: .spcache(type)
Arguments
type |
A string indicating the type of shared partner or path to be considered for directed networks: |
Details
This auxiliary maintains a single StrictDyadMapUInt
defined in ‘"ergm_dyad_hashmap.h"’. It is, internally, a
khash
table mapping a pair of Vertex
es (in a
TailHead
structure) onto an unsigned int
.
To make use of it in your change statistic:
Add
auxiliaries = ~.spcache.net(type)
to theInitErgmTerm
output list. You may request it multiple times and/or alongside other auxiliaries.Add
#include "ergm_dyad_hashmap.h"
to the top of your change statistic implementation file.In the function (e.g.,
c_
function) implementing the change statistic, useGET_AUX_STORAGE(StoreStrictDyadMapUInt, spcache);
to obtain it if this is your first or only auxiliary, orGET_AUX_STORAGE(ind, StoreStrictDyadMapUInt, spcache);
if it is not.Use one of the following macros to access the shared partner count:
GETUDMUI(TAIL, HEAD, spcache)
if undirected;
GETDDMUI(HEAD, TAIL, spcache)
if
type = "ITP"
(since ITP is OTP with direction reversed);GETDDMUI(TAIL, HEAD, spcache)
in all other cases.
Shared partner types
While there is only one shared partner configuration in the undirected
case, nine distinct configurations are possible for directed graphs, selected
using the type
argument. Currently, terms may be defined with respect to
five of these configurations; they are defined here as follows (using
terminology from Butts (2008) and the relevent
package):
Outgoing Two-path (
"OTP"
): vertexk
is an OTP shared partner of ordered pair(i,j)
iffi \to k \to j
. Also known as "transitive shared partner".Incoming Two-path (
"ITP"
): vertexk
is an ITP shared partner of ordered pair(i,j)
iffj \to k \to i
. Also known as "cyclical shared partner"Reciprocated Two-path (
"RTP"
): vertexk
is an RTP shared partner of ordered pair(i,j)
iffi \leftrightarrow k \leftrightarrow j
.Outgoing Shared Partner (
"OSP"
): vertexk
is an OSP shared partner of ordered pair(i,j)
iffi \to k, j \to k
.Incoming Shared Partner (
"ISP"
): vertexk
is an ISP shared partner of ordered pair(i,j)
iffk \to i, k \to j
.
By default, outgoing two-paths ("OTP"
) are calculated. Note that Robins et al. (2009)
define closely related statistics to several of the above, using slightly different terminology.
See Also
ergmAuxiliary
for index of auxiliaries currently visible to the package.
Keywords
directed, triad-related, undirected