Revel.jl
Specify, fit and check relational event models with the effects, interactions and diagnostics of the relational event literature. Revel.jl fits the exact likelihoods of relevent's rem.dyad over the full risk set, works with REM.jl for sampled and restricted risk sets, and adds what a review of the literature from 2008 to 2026 found missing between the packages.
Start here: Getting started · Endogenous effects · Interactions · Goodness of fit · Concordance
What the package is built around
A review of 210 works on relational event models found that the literature does not contain hundreds of distinct effects. It contains four structural configurations — the dyad (in either direction), node degree, the two-path and the three-path — crossed with a small number of measurement choices: how past events are weighted, which events count, how the statistic is scaled. The same configuration under a different measurement carries a different name in each package, which is why "inertia" is a proportion in relevent, a count in remstats, a decayed weight in rem and an indicator in goldfish.
Revel.jl is organised the same way:
| Part of the design | What it holds |
|---|---|
EventLayer | the measurement: a memory kernel, event-type and attribute filters, event weights, the clock |
| five parametric statistics | DyadEffect (the dyad, either direction), DegreeEffect and DyadDegreeEffect (one actor's degree, or two combined), TwoPathEffect, FourCycleEffect (the three-path) |
| named constructors | the literature's vocabulary: Inertia, Reciprocation, OTP, ITP, OSP, ISP, … |
| covariates | actor, dyadic and global covariates, constant or time-varying |
| interactions | the six implemented constructions: product terms, filtered statistics, type splits, attribute-weighted statistics, stratified fits and moving-window fits |
| diagnostics | prediction, score processes, score tests, simulation, closing times, collinearity |
effect_catalogue maps every effect onto its name in relevent, remstats, rem, goldfish and eventnet.
Fit a model to radio calls
The bundled World Trade Center data record 481 radio calls among 37 officers; the covariate marks the officers who held an institutional coordinator role.
Use Julia 1.12+ and the workspace installation guide for the current 0.1.0 development version, unreleased. The examples assume that environment is already prepared.
using NetworkCore, Revel
wtc = load_dataset(:wtc_police_calls)
calls = [Event(row[2], row[3], Float64(row[1])) for row in eachrow(wtc.events)]
coordinator = SumEffect(Float64.(wtc.is_icr); name="coordinator")
stats = [coordinator,
Inertia(transform=:log1p), # how often has s called r?
Reciprocation(transform=:log1p)] # how often has r called s?
fit = fit_revel(calls, stats, wtc.n_actors)
coeftable(fit) Estimate Std.Error z value Pr(>|z|)
coordinator 1.3251 0.1167 11.3588 <1e-16 ***
log1p(inertia) -0.6446 0.1541 -4.1843 2.9e-05 ***
log1p(reciprocity) 2.2634 0.1597 14.1700 <1e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
The fit is the exact ordinal likelihood over all 1332 directed dyads. Which effect is the model missing? A score test screens candidates without refitting:
candidates = [PShift(:AB_BA), # an immediate reply
RecencyRank(:send), # whom s called most recently
OTP(transform=:log1p), ISP(transform=:log1p)]
score_test(fit, candidates)| Row | term | score | variance | chisq | p_value | direction | residual_share |
|---|---|---|---|---|---|---|---|
| String | Float64 | Float64 | Float64 | Float64 | Int64 | Float64 | |
| 1 | PSAB-BA | 298.668 | 22.0406 | 4047.19 | 2.22507e-308 | 1 | 0.917419 |
| 2 | rrankSend | 160.506 | 30.5054 | 844.509 | 1.13596e-185 | 1 | 0.452465 |
| 3 | log1p(otp) | -3.74734 | 132.151 | 0.106261 | 0.744442 | -1 | 0.280708 |
| 4 | log1p(isp) | -15.3992 | 118.601 | 1.99943 | 0.157358 | -1 | 0.23016 |
The immediate reply dominates, as one expects of radio traffic. Adding it, and asking how well the model now predicts who calls whom:
better = fit_revel(calls, [stats; PShift(:AB_BA); RecencyRank(:send)], wtc.n_actors)
prediction_summary(better).recall # share of calls ranked in the top 1, 5, 103-element Vector{Float64}:
0.6798336798336798
0.7785862785862786
0.8077536566179548What can be fitted
| Task | Path |
|---|---|
| Which dyad acts next (event order) | fit_revel, full or restricted risk set, all or some events as cases |
| Receiver choice given the sender (actor-oriented) | fit_receiver_choice |
| Two-mode and undirected events | riskset=two_mode_dyads(…), directed=false |
| Waiting times as well (exponential baseline) | fit_revel(…; model=:timing) |
| Large networks | n_controls= (sampled controls), or the statistics inside REM.fit_rem |
| Effects that differ by period, context or event type | fit_stratified, fit_moving_window, Interaction |
| Multi-actor events | fit_rhem (relational hyperevents) |
Revel.jl hosts no optimizer of its own: its full-risk-set likelihoods (Revel.fit_obpm, Revel.fit_timing) and REM.fit_rem are maximised by the shared NetworkCore.newton_fit. Random effects, smooth (non-linear) effects, a dyad × type risk set, events with duration and the sender-rate step of actor-oriented models are not implemented; the concordance lists what is not implemented and what to use instead.
Citation
If you use Revel.jl in your work, please cite it using the entry in CITATION.bib, and please also cite the R packages whose models and statistics it reimplements: relevent (Butts 2008) for the relational event framework and its effects, and remstats (Meijerink-Bosman et al. 2023) for the statistics pinned against it. The per-package list is on the ecosystem's How to cite page.
@misc{SNWJRevelJL,
author = {Santoni, Simone},
title = {Revel.jl: Relational Event Effects, Interactions and Diagnostics for Julia},
year = {2026},
url = {https://github.com/statistical-network-analysis-with-Julia/Revel.jl},
note = {Homepage: https://statistical-network-analysis-with-Julia.github.io/Revel.jl; GitHub: https://github.com/statistical-network-analysis-with-Julia}
}Module
Revel — Module
Revel.jl — relational event effects, interactions and diagnosticsRevel.jl specifies, fits and checks relational event models. It holds the effects, the effect × covariate interactions and the goodness-of-fit diagnostics mapped by a review of the relational event model literature (2008–2026), organised the way that review found the literature to be organised:
- four structural configurations — the dyad (in either direction), node degree, the two-path and the three-path — as five parametric statistics (
DyadEffect,DegreeEffectandDyadDegreeEffectfor one degree or two combined,TwoPathEffect,FourCycleEffect), with the literature's names as constructors (Inertia,Reciprocation,OTP,ITP,OSP,ISP, …); - measurement choices that are orthogonal to the configuration — the memory kernel (
FullMemory,HalfLife,Window,IntervalMemory,PowerLaw,LinearDecay), event-type and attribute filters, event weights, scaling and the zero-history value — carried by anEventLayer; - exogenous effects on static or time-varying actor covariates, dyadic covariates and global covariates;
- interactions in each construction the literature uses — product terms, filtered statistics, type splits, attribute-weighted statistics, stratified and moving-window fits — kept distinct because they are different models;
- goodness of fit: prediction (ranks, recall, deviance residuals), score processes and score tests, simulation-based auxiliary statistics, closing-time distributions and a collinearity diagnostic;
- the exact full-risk-set likelihoods of
relevent::rem.dyad(src/engine/): the ordinal and the exponential interval-timing likelihood over every dyad, streamed interval by interval, with the shared tie and separation policies.
Every statistic implements both compute interfaces of the ecosystem, so it works in Revel's fit_revel (full, restricted or sampled risk sets) and in REM.fit_rem.