Internal Documentation
Documentation for EpiObsModels.jl
's internal interface.
Contents
Index
EpiAware.EpiObsModels.LDStep
EpiAware.EpiObsModels.LDStep
EpiAware.EpiAwareBase.generate_observations
EpiAware.EpiAwareBase.generate_observations
EpiAware.EpiAwareBase.generate_observations
EpiAware.EpiAwareBase.generate_observations
EpiAware.EpiAwareBase.generate_observations
EpiAware.EpiAwareBase.generate_observations
EpiAware.EpiAwareBase.generate_observations
EpiAware.EpiAwareBase.generate_observations
EpiAware.EpiAwareBase.generate_observations
EpiAware.EpiAwareUtils.get_state
EpiAware.EpiObsModels.NegativeBinomialMeanClust
EpiAware.EpiObsModels.generate_observation_kernel
Internal API
EpiAware.EpiObsModels.LDStep
— Typestruct LDStep{D<:(AbstractVector{<:Real})} <: AbstractAccumulationStep
The LatentDelay step function struct
Fields
rev_pmf::AbstractVector{<:Real}
EpiAware.EpiObsModels.LDStep
— MethodThe LatentDelay step function method for accumulate_scan
.
EpiAware.EpiAwareBase.generate_observations
— Methodgenerate_observations(
obs_model::AbstractTuringObservationErrorModel,
y_t,
Y_t
) -> Any
Generates observations from an observation error model. It provides support for missing values in observations (y_t
), and expected observations (Y_t
) that are shorter than observations. When this is the case it assumes that the expected observations are the last length(Y_t)
elements of y_t
. It also pads the expected observations with a small value (1e-6) to mitigate potential numerical issues.
It dispatches to the observation_error
function to generate the observation error distribution which uses priors generated by generate_observation_error_priors
submodel. For most observation error models specific implementations of observation_error
and generate_observation_error_priors
are required but a specific implementation of generate_observations
is not required.
EpiAware.EpiAwareBase.generate_observations
— Methodgenerate_observations(ag::Aggregate, y_t, Y_t) -> Any
Generate observations using an aggregation model.
Arguments
ag::Aggregate
: The aggregation model.y_t
: The current state of the observations. If missing, a vector of missing values is created.Y_t
: The expected observations.
Returns
- A vector of observations where entries are aggregated according to the aggregation model's specification. Only positions marked as present in the aggregation model contain non-zero values.
Details
The function:
- Broadcasts the aggregation vector to match the length of observations
- Broadcasts the present vector to match the length of observations
- For each present position, sums the expected observations over the aggregation window
- Generates observations for the aggregated values using the underlying model
- Returns a vector with observations only in the present positions
EpiAware.EpiAwareBase.generate_observations
— Methodgenerate_observations(
obs_model::Ascertainment,
y_t,
Y_t
) -> Any
Generates observations based on the LatentDelay
observation model.
Arguments
obs_model::Ascertainment
: The Ascertainment model.y_t
: The current state of the observations.Y_t
` : The expected observations.
Returns
y_t
: The updated observations.expected_aux
: Additional expected observation-related variables.obs_aux
: Additional observation-related variables.
EpiAware.EpiAwareBase.generate_observations
— Methodgenerate_observations(
obs_model::LatentDelay,
y_t,
Y_t
) -> Any
Generates observations based on the LatentDelay
observation model.
Arguments
obs_model::LatentDelay
: TheLatentDelay
observation model.y_t
: The current observations.I_t
: The current infection indicator.
Returns
y_t
: The updated observations.
EpiAware.EpiAwareBase.generate_observations
— Methodgenerate_observations(
observation_model::PrefixObservationModel,
y_t,
Y_t
) -> Any
Generate observations using a prefixed observation model.
Arguments
observation_model::PrefixObservationModel
: The prefixed observation modely_t
: The current observationsY_t
: The expected observations
Returns
The observations generated by the underlying model with prefixed parameter names
Details
This function wraps the underlying observation model's generate_observations
function using prefix_submodel
to prefix all parameter names with the specified prefix.
EpiAware.EpiAwareBase.generate_observations
— Methodgenerate_observations(
model::RecordExpectedObs,
y_t,
Y_t
) -> Any
Generate observations using a model that records the expected observations.
Arguments
model::RecordExpectedObs
: The recording model.y_t
: The current state of the observations. If missing, a vector of missing values is created.Y_t
: The expected observations.
Returns
- The observations generated by the underlying model. Additionally records
Y_t
asexp_y_t
using Turing's:=
syntax.
Details
This function wraps the underlying observation model's generate_observations
function and additionally records the expected observations Y_t
as exp_y_t
in the model.
EpiAware.EpiAwareBase.generate_observations
— Methodgenerate_observations(
obs_model::StackObservationModels,
y_t::NamedTuple,
Y_t::AbstractVector
) -> Any
Generate observations from a stack of observation models. Maps Y_t
to a NamedTuple
of the same length as y_t
assuming a 1 to many mapping.
Arguments
obs_model::StackObservationModels
: The stack of observation models.y_t::NamedTuple
: The observed values.Y_t::AbstractVector
: The expected values.
EpiAware.EpiAwareBase.generate_observations
— Methodgenerate_observations(
obs_model::StackObservationModels,
y_t::NamedTuple,
Y_t::NamedTuple
) -> Any
Generate observations from a stack of observation models. Assumes a 1 to 1 mapping between y_t
and Y_t
.
Arguments
obs_model::StackObservationModels
: The stack of observation models.y_t::NamedTuple
: The observed values.Y_t::NamedTuple
: The expected values.
EpiAware.EpiAwareBase.generate_observations
— Methodgenerate_observations(
obs::TransformObservationModel,
y_t,
Y_t
) -> Any
Generates observations or accumulates log-likelihood based on the TransformObservationModel
.
Arguments
obs::TransformObservationModel
: The TransformObservationModel.y_t
: The current state of the observations.Y_t
: The expected observations.
Returns
y_t
: The updated observations.
EpiAware.EpiAwareUtils.get_state
— Methodget_state(
acc_step::EpiAware.EpiObsModels.LDStep,
initial_state,
state
) -> Any
The LatentDelay step function method for get_state.
EpiAware.EpiObsModels.NegativeBinomialMeanClust
— MethodNegativeBinomialMeanClust(μ, α) -> SafeNegativeBinomial
Compute the mean-cluster factor negative binomial distribution.
Arguments
μ
: The mean of the distribution.α
: The clustering factor parameter.
Returns
A NegativeBinomial
distribution object.
EpiAware.EpiObsModels.generate_observation_kernel
— Methodgenerate_observation_kernel(
delay_int,
time_horizon;
partial
) -> Any
Generate an observation kernel matrix based on the given delay interval and time horizon.
Arguments
delay_int::Vector{Float64}
: The delay PMF vector.time_horizon::Int
: The number of time steps of the observation period.partial::Bool
: Whether to generate a partial observation kernel matrix.
Returns
K::SparseMatrixCSC{Float64, Int}
: The observation kernel matrix.