Internal Documentation

Documentation for EpInference.jl's internal interface.

Contents

Index

Internal API

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

Apply NUTS sampling to a DynamicPPL.Model object with prev_result representing any initial results to use for sampler initialisation.

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

Apply a ManyPathfinder method to a DynamicPPL.Model object.

If prev_result is a vector of real numbers, then the ManyPathfinder method is applied with the initial values set to prev_result. Otherwise, the ManyPathfinder method is run with default initial values generated.

source
EpiAware.EpiInference._apply_nutsMethod
_apply_nuts(
    model,
    method,
    prev_result::Pathfinder.PathfinderResult;
    kwargs...
) -> Any

Initialise NUTS with initial parameters from a Pathfinder result.

source
EpiAware.EpiInference._continue_manypathfinder!Method
_continue_manypathfinder!(
    pfs,
    mdl::DynamicPPL.Model;
    max_tries,
    nruns,
    kwargs...
)

Continue running the pathfinder algorithm until a pathfinder succeeds or the maximum number of tries is reached.

Arguments

  • pfs: An array of pathfinder objects.
  • mdl::DynamicPPL.Model: The model to perform inference on.
  • max_tries: The maximum number of tries to run the pathfinder algorithm. Default is Inf.
  • nruns: The number of times to run the pathfinder function.
  • kwargs...: Additional keyword arguments passed to pathfinder.

Returns

  • pfs: The updated array of pathfinder objects.
source
EpiAware.EpiInference._get_best_elbo_pathfinderMethod
_get_best_elbo_pathfinder(pfs) -> Any

Selects the pathfinder with the highest ELBO estimate from a list of pathfinders.

Arguments

  • pfs: A list of pathfinders results or Symbol values indicating failure.

Returns

The pathfinder with the highest ELBO estimate.

source
EpiAware.EpiInference._run_manypathfinderMethod
_run_manypathfinder(mdl::DynamicPPL.Model; nruns, kwargs...)

Run pathfinder multiple times and store the results in an array. Fails safely.

Arguments

  • mdl::DynamicPPL.Model: The Turing model to be used for inference.
  • nruns: The number of times to run the pathfinder function.
  • kwargs...: Additional keyword arguments passed to pathfinder.

Returns

An array of PathfinderResult objects or Symbol values indicating success or failure.

source