Internal API
Documentation for ComposableTuringIDModels's unexported internal helpers and supertypes. These are not part of the stable public API; they are documented because the public docstrings cross-reference them.
Index
ComposableTuringIDModels.ARStepComposableTuringIDModels.AbstractAccumulationStepComposableTuringIDModels.AbstractBroadcastRuleComposableTuringIDModels.AbstractConstantRenewalStepComposableTuringIDModels.AbstractIDMethodComposableTuringIDModels.AbstractIDSamplingMethodComposableTuringIDModels.AbstractRenewalModifierComposableTuringIDModels.ComposedRenewalStepComposableTuringIDModels.ConstantRenewalStepComposableTuringIDModels.ConstantRenewalWithPopulationStepComposableTuringIDModels.LDStepComposableTuringIDModels.MAStepComposableTuringIDModels.RWStepComposableTuringIDModels.SafeIntValuedComposableTuringIDModels.SusceptibleDepletionComposableTuringIDModels._expand_distComposableTuringIDModels.neg_MGFComposableTuringIDModels.remake_ode_problemComposableTuringIDModels.renewal_foi
ComposableTuringIDModels.AbstractAccumulationStep Type
Abstract supertype for accumulation step structs used with accumulate_scan.
A concrete AbstractAccumulationStep is a callable (step)(state, ϵ) returning the next state. It is backend-agnostic: it contains no Turing/DynamicPPL machinery and is reused unchanged across model components (RandomWalk, AR, MA, LatentDelay).
ComposableTuringIDModels.AbstractBroadcastRule Type
Abstract supertype for broadcast rules used by BroadcastLatentModel. A rule defines broadcast_n (how long an inner series to generate) and broadcast_rule (how to expand it to length n).
ComposableTuringIDModels.AbstractConstantRenewalStep Type
Abstract supertype for renewal accumulation steps (constant generation interval, with or without susceptible depletion).
sourceComposableTuringIDModels.AbstractIDMethod Type
Abstract supertype for inference / generative-modelling methods.
sourceComposableTuringIDModels.AbstractIDSamplingMethod Type
Abstract supertype for sampling-based methods (e.g. NUTS).
sourceComposableTuringIDModels.AbstractRenewalModifier Type
Abstract supertype for renewal modifiers used with ComposedRenewalStep.
A modifier transforms the proposed new incidence and carries its own substate across the scan. Concrete modifiers implement
modifier_init_state(mod)— the modifier's initial substate.apply_modifier(mod, incidence, substate)— return(new_incidence, new_substate).
ComposableTuringIDModels.ComposedRenewalStep Type
A renewal accumulation step assembled from a force-of-infection core (a ConstantRenewalStep) and a tuple of modifiers (AbstractRenewalModifiers), sharing one incidence window.
Its state is [window, substate₁, …, substateₙ]: the incidence window followed by one substate per modifier. Each step computes the core force of infection, threads it through the modifiers (each transforming the incidence and updating its own substate), then advances the shared window once with the final incidence.
ComposedRenewalStep(ConstantRenewalStep(g), (SusceptibleDepletion(N),)) reproduces ConstantRenewalWithPopulationStep(g, N); this equivalence is the acceptance test for the composable contract (#48).
ComposableTuringIDModels.ConstantRenewalStep Type
Renewal step with a constant generation interval (stored reversed).
ComposableTuringIDModels.ConstantRenewalWithPopulationStep Type
Renewal step with a constant generation interval and a fixed population (with susceptible depletion).
ComposableTuringIDModels.SafeIntValued Type
A value-support tag for real-valued count distributions whose eltype must stay integer-typed inside a Turing model even when rand is called.
ComposableTuringIDModels.SusceptibleDepletion Type
Susceptible-depletion modifier for ComposedRenewalStep.
Scales the proposed incidence by the available susceptible fraction and depletes the susceptible pool,
with population size pop_size. Its substate is the current susceptible count ConstantRenewalStep reproduces ConstantRenewalWithPopulationStep exactly.
ComposableTuringIDModels._expand_dist Function
Expand a vector of distributions into a single product distribution.
If every element of dist is equal, a filldist is returned for efficiency; otherwise an arraydist over the heterogeneous vector is returned.
ComposableTuringIDModels.neg_MGF Function
Negative moment generating function of a discrete generation interval w at rate r:
Arguments
r: the exponential growth rate.w: the discrete generation interval weights.
Examples
using ComposableTuringIDModels
ComposableTuringIDModels.neg_MGF(0.1, [0.2, 0.3, 0.5])ComposableTuringIDModels.remake_ode_problem Function
Rebuild an ODEProcess's ODEProblem with freshly sampled state u0 and parameters p.
This is the single seam through which ODEProcess re-instantiates its problem on every sample. The default applies the plain-vector remake(prob; u0, p) that the hand-coded SIRParams / SEIRParams problems expect.
Parameter models whose problem stores parameters differently — e.g. a ModelingToolkit/Catalyst-built problem carrying a structured MTKParameters object plus an initialization system — specialise this on their own type to inject the remake form they need. The Catalyst extension uses the plain-vector build_initializeprob = false path to bypass the init system (and stay reverse-mode differentiable). Dispatching on the parameter model keeps ODEProcess itself backend-agnostic.
Arguments
params: the ODE parameter model (theODEProcess'sparamsfield).prob: the templateODEProblemto rebuild.u0: the sampled initial state vector.p: the sampled parameter vector.
ComposableTuringIDModels.renewal_foi Function
Force of infection for a constant-generation-interval renewal step: the reproduction number
This is the raw new-incidence term before any modifier (e.g. susceptible depletion) is applied. It is shared by ConstantRenewalStep and the composable ComposedRenewalStep so the two cannot drift.