Internal Documentation

Documentation for EpiAwareUtils.jl's internal interface.

Contents

Index

Internal API

EpiAware.EpiAwareBase._apply_methodFunction
_apply_method(
    model::DynamicPPL.Model,
    method::DirectSample;
    ...
) -> Any
_apply_method(
    model::DynamicPPL.Model,
    method::DirectSample,
    prev_result;
    kwargs...
) -> Any

Implements direct sampling from a Turing model.

source
EpiAware.EpiAwareBase._apply_methodFunction
_apply_method(
    model::DynamicPPL.Model,
    method::AbstractEpiMethod;
    ...
) -> Any
_apply_method(
    model::DynamicPPL.Model,
    method::AbstractEpiMethod,
    prev_result;
    kwargs...
) -> Any

Apply the inference/generative method method to the Model object mdl.

Arguments

  • model::AbstractEpiModel: The model to apply the method to.
  • method::AbstractEpiMethod: The epidemiological method to apply.
  • prev_result: The previous result of the method.
  • kwargs: Additional keyword arguments passed to the method.

Returns

  • nothing: If no concrete implementation is defined for the given method.
source
EpiAware.EpiAwareBase._apply_methodMethod
_apply_method(
    model::DynamicPPL.Model,
    method::EpiMethod,
    prev_result;
    kwargs...
) -> Any

Apply steps defined by an EpiMethod to a model object.

This function applies the steps defined by an EpiMethod object to a Model object. It iterates over the pre-sampler steps defined in the EpiMethod object and recursively applies them to the model. Finally, it applies the sampler step defined in the EpiMethod object to the model. The prev_result argument is used to pass the result obtained from applying the previous steps, if any.

Arguments

  • method::EpiMethod: The EpiMethod object containing the steps to be applied.
  • model::Model: The model object to which the steps will be applied.
  • prev_result: The previous result obtained from applying the steps. Defaults to nothing.
  • kwargs...: Additional keyword arguments that can be passed to the steps.

Returns

  • prev_result: The result obtained after applying the steps.
source
EpiAware.EpiAwareBase._apply_methodMethod
_apply_method(
    model::DynamicPPL.Model,
    method::EpiMethod;
    kwargs...
) -> Any

Apply a method to a mode without previous results

Arguments

  • model::Model: The model to apply the method to.
  • method::EpiMethod: The method to apply.
  • kwargs...: Additional keyword arguments.

Returns

  • The result of applying the method to the model.
source
EpiAware.EpiAwareBase.condition_modelMethod
condition_model(
    model::DynamicPPL.Model,
    fix_parameters::NamedTuple,
    condition_parameters::NamedTuple
) -> Any

Apply the condition to the model by fixing the specified parameters and conditioning on the others.

Arguments

  • model::Model: The model to be conditioned.
  • fix_parameters::NamedTuple: The parameters to be fixed.
  • condition_parameters::NamedTuple: The parameters to be conditioned on.

Returns

  • _model: The conditioned model.
source
EpiAware.EpiAwareBase.generate_epiawareMethod
generate_epiaware(
    y_t,
    time_steps,
    epi_model::AbstractTuringEpiModel;
    latent_model,
    observation_model
)

Generate an epi-aware model given the observed data and model specifications.

Arguments

  • y_t: Observed data.
  • time_steps: Number of time steps.
  • epi_model: A Turing Epi model specification.
  • latent_model: A Turing Latent model specification.
  • observation_model: A Turing Observation model specification.

Returns

A DynamicPPPL.Model object.

source
EpiAware.EpiAwareBase.generated_observablesMethod
generated_observables(
    model::DynamicPPL.Model,
    data,
    solution::Union{NamedTuple, MCMCChains.Chains}
) -> EpiAwareObservables

Generate observables from a given model and solution including generated quantities.

source
EpiAware.EpiAwareUtils._apply_direct_sampleMethod
_apply_direct_sample(
    model,
    method,
    n_samples::Int64;
    kwargs...
) -> Any

Sample the model directly using Turing.Prior() and a NamedTuple of the sampled random variables along with generated quantities.

source
EpiAware.EpiAwareUtils._check_and_give_tsMethod
_check_and_give_ts(
    dist::Distributions.Distribution,
    Δd,
    D,
    upper
) -> Any

Internal function to check censored_pmf arguments and return the time steps of the rightmost limits of the censor intervals.

source