EGPHazard {ergmgp}R Documentation

Calculate Transition Hazards for an ERGM Generating Process

Description

Given an EGP and an initial state, calculate the transition rates to one or more neighboring states.

Usage

EGPHazard(form, coef, toggles = NULL, rate.factor = 1, process = c("LERGM",
    "CRSAOM", "CI", "DS", "CDCSTERGM", "CFCSTERGM", "CSTERGM", "CTERGM"))

Arguments

form

an ERGM formula for the EGP (or a list with formation and dissolution formulas, for CSTERGM processes). The left-hand side is used as the current state when computing transition rates.

coef

a vector of EGP coefficients, or a list of vectors with elements formation and dissolution for CSTERGM and variants.

toggles

edge variables to evaluate; passing "all" or NULL leads to all edge variables being evaluated, "edges" evaluates only dissolution events, "nulls" evaluates only formation events, and passing a two-column matrix of IDs (tail, head order) evaluates the selected dyads.

rate.factor

rate or pacing factor (sets the time scale).

process

the ERGM generating process to use.

Details

An ERGM generating process (EGP) is a continuous time graph process with an equilibrium distribution having a known ERGM form. See ergmgp for an overview of EGPs, including the specifications supported here.

EGPHazard calculates the log transition rates (i.e., hazards) from an initial or current state (specified by the left-hand side of the input formula) to one or more target states. These states are specified by the edge variables whose states would change (often called “toggles” in ERGM nomenclature). By default, all possible transitions are evaluated; this can also be obtained by setting toggles=="all". Dissolution rates for all current edges can be obtained by setting toggles=="edges", and formation rates for all current nulls can be obtained by setting toggles=="nulls". Otherwise, the toggles argument expects a two-column matrix of tail and head vertex IDs indicating the edge variables to be evaluated. Note that only instantaneous rates from the origin state are computed; toggles are not cumulative.

EGP specifications are as per simEGP. Transition rates for all currently implemented EGPs follow the specifications of Butts (2023), with the trivial addition of a pacing constant for all families (which simply sets the timescale).

Value

a matrix containing the toggles, indicators for whether each event would have been a formation event, and the log event hazards (one row per toggle).

Author(s)

Carter T. Butts buttsc@uci.edu

References

Butts, Carter T. (2023). “Continuous Time Graph Processes with Known ERGM Equilibria: Contextual Review, Extensions, and Synthesis.” Journal of Mathematical Sociology. doi:10.1080/0022250X.2023.2180001

See Also

ergmgp for information on EGPs, ergm for information on ERGM specifications, simEGP

Examples

#Simulate a small network with triadic dependence
n <- 25
set.seed(1331)
co <- c(log(2.5/(n-3.5)), -0.75)
net <- simulate(network.initialize(n, directed=FALSE) ~ edges + esp(0),
    coef = co)

#Compute all rates under a LERGM
lr <- EGPHazard(net ~ edges + esp(0), coef = co, process = "LERGM")
head(lr)  #Sender, receiver, formation (1=yes), log rate

#Use a toggle matrix to obtain the same outcome
lrt <- EGPHazard(net ~ edges + esp(0), coef = co, toggles = lr[,1:2],
    process = "LERGM")
all(lrt == lr)   #TRUE

#Examine edge dissolution rates
ldissr <- EGPHazard(net ~ edges + esp(0), coef = co, toggles = "edges", 
    process = "LERGM")
a <- function(z){(z-min(z))/diff(range(z))}
plot(net, edge.col = hsv(a(ldissr[,4])*0.6))  #Blue=fast, red=slow


[Package ergmgp version 0.1-1 Index]