← Back to all sparks
E

epidemics

ANALYTICS
Velocity3.8

A library of published compartmental epidemic models, and classes to represent demographic structure, non-pharmaceutical interventions, and vaccination regimes, to compose epidemic

epidemics swapped its C++ engine for odin — and quietly inverted how contact matrices must be passed.

epiverse-tracecompartmental-modelsodinbreaking-changesode-solvers
Current state
epidemics ships composable compartmental model structures — default SEIR-V, Vacamole, diphtheria and Ebola — with classes for populations, interventions and vaccination campaigns. After more than two years without a release, 0.5.0 landed in July 2026 carrying both an engine migration and a breaking input-convention change. Maintainership moved to a new lead back in 0.4.0.
Where it's heading
The package's history is a sequence of deliberate breaking releases: 0.2.0 renamed every model function and vectorised the ODE models, 0.3.0 restructured the Ebola model into two levels and made replicates the default, and 0.5.0 rewrites the compiled core. The direction is toward a smaller, more declarative model definition layer with the numerical work delegated to a dedicated tool.
Prediction
With the default, Vacamole and diphtheria systems now declared in odin, the Ebola model is the obvious remaining candidate for the same treatment.

Recent moves

  1. 25d ago

    ODE models migrate to odin; contact matrices must no longer be transposed

    ⚡ SPARK

    Two changes of different kinds arrive together: the compiled model core moves from Rcpp/C++ to odin declarations under inst/odin/, and social contact matrices from socialmixr must now be passed exactly as returned. The second is the dangerous one — existing t() calls still run and silently produce wrong results.

    View source ↗
  2. 2y ago

    Peak timing and scenario comparison helpers; negative-susceptible bug fixed

    Adds epidemic_peak() for the timing and size of the largest peak per compartment and outcomes_averted() for comparing scenarios with and without interventions, and fixes internal vaccination functions that could drive susceptible counts below zero.

    View source ↗
  3. 2y ago

    Ebola model accepts vector inputs and defaults to 100 replicates

    The stochastic Ebola model runs 100 replicates by default and returns a replicate column, and epidemic_size() now excludes the dead compartment by default. Both are breaking changes to output shape and interpretation.

    View source ↗
  4. 2y ago

    ODE models vectorised; every model function renamed

    Model functions become model_<name>() with language suffixes dropped, and the Vacamole vaccination parameters are re-expressed so users supply the effect directly rather than its inverse. A large breaking release aimed at a consistent interface.

    View source ↗
  5. 2y ago

    First release: four composable compartmental model structures

    The initial GitHub release, published explicitly so projects already using the package could reproduce their results before the planned breaking changes landed.

    View source ↗