Skip to contents

amorem

amorem — end-to-end simulation, sampling, feature engineering, model selection, and inference for relational event models (REMs) in R, in one consistent API.

The package consolidates four lines of recent methodological work:

Installation

# install.packages("remotes")
remotes::install_github("franciscorichter/amorem")

30-second tour

library(amorem)

# 1. Bundled datasets, ready to load
data(classroom_events)        # 691 events,    20 actors  (McFarland 2001)
data(social_evolution_calls)  # 439 events,    54 actors  (Madan et al. 2011)
data(radoslaw_email)          # 82,927 emails, 167 actors (Michalski et al. 2014)

# 2. Compute endogenous features post-hoc from any (sender, receiver, time) log
feat <- compute_endogenous_features(
  classroom_events, stats = c("reciprocity", "recency"))

# 3. Simulate a ready-to-fit case-1-control table with known structure ...
w <- simulate_relational_events(
  n_events = 1500, senders = LETTERS[1:8], receivers = LETTERS[1:8],
  n_controls = 1, endogenous_stats = "reciprocity_count",
  endogenous_effects = c(reciprocity_count = 0.4), wide = TRUE)

# 4. ... and fit it with the default "gam" backend
fit <- rem(~ reciprocity_count, data = w, method = "gam")
summary(fit)

What’s inside

Guides

Guide What you’ll find
Quick start install + simulate-and-recover in a few lines
Simulation the dyadic mechanisms, Gillespie vs τ-leap
Endogenous catalogue the statistic catalogue and its variant axes
Estimation case-control sampling, the three rem() backends — clogit (linear), gam (smooth tv/nl/tvnl/re effects), nn (neural conditional logit) — model comparison, GOF
Hyperedge models the (I, J, time) data model and RHEM simulators
Datasets the bundled REM datasets
Real-data analysis sender-frailty flip, smooth effect curves
Validation experiments recovery, smooth, scaling, parity, and the neural backend (gradient check + interaction recovery)

Full per-function documentation is under Reference.

References

  • Juozaitienė R., Wit E.C. (2024). It’s about time: revisiting reciprocity and triadicity in relational event analysis. JRSS-A 188(4), 1246–1262. doi:10.1093/jrsssa/qnae132.
  • Boschi M., Lerner J., Wit E.C. (2025). Beyond Linearity and Time-Homogeneity: Relational Hyper Event Models with Time-Varying Non-Linear Effects. arXiv:2509.05289.
  • Lembo M., Juozaitienė R., Vinciotti V., Wit E.C. (2025). Relational Event Models with Global Covariates. JRSS-C.
  • Boschi M., Wit E.C. (2025). Goodness of fit in relational event models. Statistics and Computing 36(4).