| events | R Documentation |
When relationships are born and when they die. In a static network every edge is present at once; here the turnover itself is the finding. A course typically shows formation front-loaded and dissolution piling up at the end, and a group that never dissolves an edge is behaving differently from one that constantly re-forms them.
events(
dn,
measure = c("formation", "dissolution"),
sessions = c("bounded", "collapse", "separate"),
start = NULL,
end = NULL,
step = NULL,
window = NULL,
plot = FALSE
)
dn |
A temporal network from |
measure |
One or more of |
sessions |
How to treat sessions: |
start, end |
First and last time at which to measure. Default to the observed range. A network built from dates may be addressed with dates. |
step |
How often to measure. Defaults to the interval the network was built with. |
window |
How much time each measurement covers. Defaults to |
plot |
Whether to draw the result as well as return it. Drawing is a
side effect in the manner of |
Formation and dissolution are counted inside each window, so overlapping
windows (window > step) count the same event more than once by design –
that is what a rolling total is. Setting window equal to step, the
default, gives disjoint counts that sum to the total turnover.
Explicitly onset-censored raw limits are not formations, and explicitly
terminus-censored limits are not dissolutions. A left-censored observed tie
is prior evidence for new_pairs; raw censor state never changes activity.
Formation fraction is defined only with window = 0. For a positive
half-open interval [s,e), its pre-batch state at t is
s < t <= e and its post-batch state is s <= t < e. These predicates are
binary-unioned per nonloop ordered pair or undirected dyad after the entire
timestamp batch. Points are absent on both sides. A pair enters risk only
when observation and both endpoints are eligible immediately before and
after t and the pair is inactive before. A formation is confirmed when it
is active after and at least one contributing positive raw spell has a known
onset at t. The ratio is in [0,1]; zero risk returns NA.
Duplicate, overlapping, or adjacent raw spells cannot multiply pair-state transitions. Observation and vertex boundaries are excluded by two-sided eligibility. Onset censoring suppresses confirmation but not state; terminus censoring, weights, loops, and point contacts do not contribute. Collapse erases labels, bounded authorises within sessions before unioning each calendar pair, and separate returns session-local fractions.
Dissolution fraction is the dual exact-time quantity. For each nonloop pair,
let E- and E+ be binary-union state on the symbolic one-sided limits and
let L mean at least one positive raw spell ends exactly at the timestamp
with a known terminus. The numerator is Z * E- * (1 - E+) * L, where Z
requires two-sided observation and endpoint eligibility; the denominator is
sum(Z * E-), including pairs that remain active. Zero risk returns
NA_real_, while positive risk with no confirmed dissolution returns zero.
Censor flags do not change state: one known terminus confirms a disappearance
but an all-censored disappearance is unconfirmed. Duplicate, overlapping,
adjacent, and tied rows are unioned; points, loops, weights, onset censoring,
and administrative observation/activity boundaries do not create transitions.
Collapse erases labels, bounded unions authorised session-local states, and
separate reports local rows. Positive windows are rejected because
"dissolution_rate" owns
dissolution rates.
Dissolution rate is the active-risk dual over a positive window. Its
numerator sums confirmed binary pair dissolutions at included timestamp
batches; its denominator integrates exact eligible active nonloop pair-time
over observation, vertex, edge, and window change cells. Right-censored
termini retain state and exposure but do not confirm an event, while one
known duplicate suffices. Zero active exposure returns NA_real_; positive
exposure without a confirmed dissolution is zero. The unit is inverse
network time. It is not raw terminus intensity, spell-duration sum, or an
average of instantaneous fractions; positive windows are required, and this
is the rate "dissolution_rate" reports.
Formation rate is the positive-window counterpart. Its numerator sums the
confirmed binary pair formations at each included timestamp, while its
denominator integrates exact inactive eligible nonloop pair-time over
change-point cells cut by the window, observation components, vertex
activity, and edge state. It is not an average of instantaneous fractions,
a raw-onset intensity, or an ever-observed-pair quantity. Zero exposure
returns NA_real_; positive exposure with no confirmed formation returns
zero. The unit is inverse network time and scales inversely with positive
time scaling. Points have zero exposure, onset censoring suppresses only
confirmation, and gap/boundary, duplicate, overlap, adjacency, loop,
weight, and session rules follow the same ledger as
"formation_fraction". window = 0 is rejected because that measure owns
the instantaneous fractions.
A dynet_metric at graph level, one row per time point and
measure.
Andersen, P. K., & Gill, R. D. (1982). Cox's regression model for counting processes: a large sample study. Annals of Statistics, 10, 1100-1120. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1214/aos/1176345976")}
Butts, C. T., Leslie-Cook, A., Krivitsky, P. N., & Bender-deMoll, S. (2024). networkDynamic: Dynamic Extensions for Network Objects, version 0.11.5. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.32614/CRAN.package.networkDynamic")}
dn <- dynet(school_contacts)
events(dn)
turnover <- events(dn, measure = c("formation", "dissolution"))
plot(turnover)
events(dn, measure = "formation_fraction", start = 1, end = 1,
window = 0)
events(dn, measure = "dissolution_fraction", start = 1, end = 1,
window = 0)
events(dn, measure = "formation_rate", start = 1, end = 2,
window = 1)
events(dn, measure = "dissolution_rate", start = 1, end = 2,
window = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.