Internal Documentation
Documentation for EpiAwareUtils.jl
's internal interface.
Contents
Index
EpiAware.EpiAwareBase._apply_method
EpiAware.EpiAwareBase._apply_method
EpiAware.EpiAwareBase._apply_method
EpiAware.EpiAwareBase._apply_method
EpiAware.EpiAwareBase.condition_model
EpiAware.EpiAwareBase.generate_epiaware
EpiAware.EpiAwareBase.generated_observables
EpiAware.EpiAwareUtils._apply_direct_sample
EpiAware.EpiAwareUtils._apply_direct_sample
EpiAware.EpiAwareUtils._check_and_give_ts
Internal API
EpiAware.EpiAwareBase._apply_method
— Function_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 givenmethod
.
EpiAware.EpiAwareBase._apply_method
— Function_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.
EpiAware.EpiAwareBase._apply_method
— Method_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
: TheEpiMethod
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 tonothing
.kwargs...
: Additional keyword arguments that can be passed to the steps.
Returns
prev_result
: The result obtained after applying the steps.
EpiAware.EpiAwareBase._apply_method
— Method_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.
EpiAware.EpiAwareBase.condition_model
— Methodcondition_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.
EpiAware.EpiAwareBase.generate_epiaware
— Methodgenerate_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.
EpiAware.EpiAwareBase.generated_observables
— Methodgenerated_observables(
model::DynamicPPL.Model,
data,
solution::Union{NamedTuple, MCMCChains.Chains}
) -> EpiAwareObservables
Generate observables from a given model and solution including generated quantities.
EpiAware.EpiAwareUtils._apply_direct_sample
— Method_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.
EpiAware.EpiAwareUtils._apply_direct_sample
— Method_apply_direct_sample(
model,
method,
n_samples::Nothing
) -> Any
Sample the model directly using rand and return a single set of sampled random variables.
EpiAware.EpiAwareUtils._check_and_give_ts
— Method_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.