EpiBranch.jl
EpiBranch.jl is a Julia package for branching-process and related models in epidemiology. It does both stochastic simulation and analytical inference, and uses closed-form results where they exist. A flexible extension interface includes interventions, host attributes, and structured transmission over contact networks and within households, each a companion package built on the same engine. See Extending EpiBranch for the extension points.
It started as a unification of five R packages (cf. ringbp, simulist, epichains, superspreading and pepbp) but adds type-structured offspring and a single interface across simulation and analytical methods.
EpiBranch.jl separates the offspring draw from timing and interventions: the branching process draws contacts, generation times are assigned independently, and interventions act as competing risks that decide whether each contact is actually infected. For more on the design, see Design.
Quick start
using EpiBranch
using Distributions
using StableRNGs
iso = Isolation(onset_to_isolation_delay = Exponential(2.0))
ct = ContactTracing(OnSymptomOnset(), 0.5, Exponential(1.5), Quarantine())
# A model composes a process with the population (attributes) and the
# policy in force (interventions) via a ModelSpec; simulate reads both from it.
model = ModelSpec(BranchingProcess(NegBin(2.5, 0.16), LogNormal(1.6, 0.5));
interventions = [iso, ct],
attributes = clinical_presentation(incubation_period = LogNormal(1.5, 0.5)),
)
rng = StableRNG(42)
results = simulate(model, 500; max_cases = 5000, rng = rng)
containment_probability(results)0.966Installation
EpiBranch.jl is in the General registry:
using Pkg
Pkg.add("EpiBranch")The household and network models live in the same repository as companion packages; install them from their subdirectories:
Pkg.add(url = "https://github.com/epiforecasts/EpiBranch.jl", subdir = "lib/EpiHouseholds")
Pkg.add(url = "https://github.com/epiforecasts/EpiBranch.jl", subdir = "lib/EpiNetwork")