Skip to content

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.ARStep Type

Autoregressive step for use with accumulate_scan.

source
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).

source
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).

source
ComposableTuringIDModels.AbstractConstantRenewalStep Type

Abstract supertype for renewal accumulation steps (constant generation interval, with or without susceptible depletion).

source
ComposableTuringIDModels.AbstractIDMethod Type

Abstract supertype for inference / generative-modelling methods.

source
ComposableTuringIDModels.AbstractIDOptMethod Type

Abstract supertype for optimisation-based methods (e.g. variational initialisation) used as a pre-sampler step.

source
ComposableTuringIDModels.AbstractIDSamplingMethod Type

Abstract supertype for sampling-based methods (e.g. NUTS).

source
ComposableTuringIDModels.ConstantRenewalStep Type

Renewal step with a constant generation interval (stored reversed).

source
ComposableTuringIDModels.ConstantRenewalWithPopulationStep Type

Renewal step with a constant generation interval and a fixed population (with susceptible depletion).

source
ComposableTuringIDModels.LDStep Type

LatentDelay step for use with accumulate_scan.

source
ComposableTuringIDModels.MAStep Type

Moving-average step for use with accumulate_scan.

source
ComposableTuringIDModels.RWStep Type

Random walk step for use with accumulate_scan.

source
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.

source
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.

source
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

@example
using ComposableTuringIDModels
ComposableTuringIDModels.neg_MGF(0.1, [0.2, 0.3, 0.5])
source
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 (the ODEProcess's params field).

  • prob: the template ODEProblem to rebuild.

  • u0: the sampled initial state vector.

  • p: the sampled parameter vector.

source