Getting started
A recurrence computes each value from its own past values, such as infections from earlier infections. A convolution weights the past values of another series, such as reported cases from earlier infections. Recurrence and Convolution are the two operators. Couplings link strata, such as towns, and modifiers add behaviour such as finite pools to each step. Every operator is differentiable. Operators run on CPU threads and on GPU arrays through executors. On Julia 1.12 and later, a forward run compiles into a trimmed executable with juliac.
Where to start
New to the package? Three towns, step by step builds an outbreak model one part at a time.
Looking for an operator, coupling or modifier? See the API overview.
Is your data weekly or monthly? See Time units.
Have a model in mind? Each tutorial in this section builds one, starting with Renewal then delay.
Coming from epidemiology? Infectious disease models maps renewal processes, delays and occupancy to the package.
Want to know how it works? The How it works pages start with the API overview.
Want to write your own modifier or coupling? See the Developer documentation.
Want the full interface? See the Public API.
Need GPUs, an AD backend or distributions? See Extensions.
Extensions
Each extension loads by itself when you load its packages alongside ComposableRecurrences. None is needed to build or run a model.
| Load | Adds | Use it for | Page |
|---|---|---|---|
using Distributions | Discrete distributions as delay kernels | Delays from a named distribution | Distributions |
using CensoredDistributions, Distributions | Continuous distributions as kernels, censored to whole lags | Continuous delays | CensoredDistributions |
using ForwardDiff | Dual-number local step for couplings and modifiers without a pullback! | Faster reverse-mode gradients through them | ForwardDiff |
using Enzyme | Enzyme reverse-mode rules | Enzyme gradients | Enzyme |
using Mooncake | Mooncake reverse-mode rules and test_adjoint | Mooncake gradients | Mooncake |
using ADTypes, Enzyme, EnzymeTestUtils | test_adjoint for AutoEnzyme | Testing a new rule | EnzymeTestUtils |
using FFTW | FFT lag sums for Convolution | Long kernels over long series | FFTW |
using Functors | convert_floats | Runs in Float32 | Functors |
using KernelAbstractions | Parallel executor and Adapt rules | Kernels without a GPU package | KernelAbstractions |
using CUDA, KernelAbstractions, or any GPUArrays backend | Calls on device arrays, including CSR couplings, run as kernels | GPUs | GPUArrays |
using Reactant, KernelAbstractions, CUDA | Compiled calls on traced arrays | Compiling a model with Reactant | Reactant |
Getting help
For usage questions, ask on the Julia Discourse or the epinowcast community forum, our home for epidemiological modelling questions. Please use GitHub issues for bug reports and feature requests only.