REM.jl

Model which dyad acts next, given past interactions and the actors eligible to participate. REM.jl fits ordinal relational event models to sender–receiver event sequences, using eventnet-style history statistics and stratified conditional logistic regression.

Start here: Getting started · Events and risk sets · Statistics · Estimation API

Fit the bundled radio calls

The World Trade Center police radio dataset contains 481 calls and a declared universe of 37 officers, including two who never appear in the calls. Its clock is event order. The model below relates event choice to whether the sender or receiver holds an institutionalized coordinator role.

Use Julia 1.12+ and the workspace installation guide for the current 0.2.0 development version, unreleased. The examples assume that environment is already prepared.

Outside that workspace, the event-data and estimation guides also use four registered packages: Pkg.add(["DataFrames", "CSV", "StatsBase", "Distributions"]) (StatsBase for countmap, Distributions for the likelihood-ratio test).

using NetworkCore, REM

wtc = load_dataset(:wtc_police_calls)
n = wtc.n_actors
calls = [Event(row[2], row[3], Float64(row[1])) for row in eachrow(wtc.events)]
seq = EventSequence(calls; actors=ActorSet(1:n))
icr = NodeAttribute(:icr, Dict(i => Float64(wtc.is_icr[i]) for i in 1:n))

# Compare each call with every other eligible directed dyad.
fit = fit_rem(seq, [NodeSum(icr)]; n_controls=n * (n - 1) - 1)
@assert fit.converged && !fit.singular && isempty(fit.separated)
coeftable(fit)
NetworkCore.fit_metadata(fit)

NodeSum(icr) is the sender-plus-receiver role covariate. Its coefficient is about 2.10 on these data. The tutorial adds repetition, reciprocity and actor activity, then explains sampled controls and uncertainty.

Choose the right likelihood and risk set

NeedCurrent support
Next-event choiceOrdinal partial likelihood; enumerate the full risk set when affordable or sample controls with a seeded rng (use ties=:breslow, not :efron, on tied data with sampled controls).
Changing eligibilityDeclared actor sets, asymmetric sender/receiver sets, per-event risk sets and callbacks; every observed event must be eligible.
History and timeDyadic, degree, triadic, four-cycle and attribute statistics; optional half-life decay or a sliding window.
Uncertainty and diagnosticsHessian or event-clustered sandwich covariance, convergence/identification warnings, fit metadata and a separate control-draw sensitivity diagnostic.

REM.jl does not fit inter-event durations or a baseline event rate. Use Revel.jl for the exponential timing model (fit_revel(...; model=:timing)), participation shifts, typed and time-varying effects and goodness-of-fit diagnostics. Use Siena.jl when your observations are network waves rather than individual events.

Tied timestamps require an explicit policy; the default is refusal. With sampled controls, a misspecified model's estimate can depend on the draw and control count. Check converged, singular, separated and NetworkCore.approximations(fit) before inference: numerical convergence alone does not establish identification. Reference fixtures validate selected designs and fits against R, not every model an analyst can specify. See model estimation.

Package citation: CITATION.bib.

Module

REM — Module
REM.jl - Relational Event Models for Julia

A Julia implementation for statistical analysis of relational event networks. Port of eventnet (https://github.com/juergenlerner/eventnet).

Relational Event Models (REM) are statistical models for analyzing sequences of time-stamped relational events to uncover factors explaining why some actors interact at higher rates than others.

source