Internal Documentation

Documentation for EpiObsModels.jl's internal interface.

Contents

Index

Internal API

EpiAware.EpiObsModels.LDStepType
struct LDStep{D<:(AbstractVector{<:Real})} <: AbstractAccumulationStep

The LatentDelay step function struct


Fields

  • rev_pmf::AbstractVector{<:Real}
source
EpiAware.EpiAwareBase.generate_observationsMethod
generate_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.

source
EpiAware.EpiAwareBase.generate_observationsMethod
generate_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:

  1. Broadcasts the aggregation vector to match the length of observations
  2. Broadcasts the present vector to match the length of observations
  3. For each present position, sums the expected observations over the aggregation window
  4. Generates observations for the aggregated values using the underlying model
  5. Returns a vector with observations only in the present positions
source
EpiAware.EpiAwareBase.generate_observationsMethod
generate_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.
source
EpiAware.EpiAwareBase.generate_observationsMethod
generate_observations(
    obs_model::LatentDelay,
    y_t,
    Y_t
) -> Any

Generates observations based on the LatentDelay observation model.

Arguments

  • obs_model::LatentDelay: The LatentDelay observation model.
  • y_t: The current observations.
  • I_t: The current infection indicator.

Returns

  • y_t: The updated observations.
source
EpiAware.EpiAwareBase.generate_observationsMethod
generate_observations(
    observation_model::PrefixObservationModel,
    y_t,
    Y_t
) -> Any

Generate observations using a prefixed observation model.

Arguments

  • observation_model::PrefixObservationModel: The prefixed observation model
  • y_t: The current observations
  • Y_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.

source
EpiAware.EpiAwareBase.generate_observationsMethod
generate_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 as exp_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.

source
EpiAware.EpiAwareBase.generate_observationsMethod
generate_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.
source
EpiAware.EpiAwareBase.generate_observationsMethod
generate_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.
source
EpiAware.EpiAwareBase.generate_observationsMethod
generate_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.
source
EpiAware.EpiObsModels.NegativeBinomialMeanClustMethod
NegativeBinomialMeanClust(μ, α) -> SafeNegativeBinomial

Compute the mean-cluster factor negative binomial distribution.

Arguments

  • μ: The mean of the distribution.
  • α: The clustering factor parameter.

Returns

A NegativeBinomial distribution object.

source
EpiAware.EpiObsModels.generate_observation_kernelMethod
generate_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.
source