Skip to contents

Linelist data

Functions for preparing linelist data

as_epidist_linelist_data()
Create an epidist_linelist_data object
as_epidist_linelist_data(<data.frame>)
Create an epidist_linelist_data object from a data frame with event dates
as_epidist_linelist_data(<default>)
Create an epidist_linelist_data object from vectors of event times
assert_epidist(<epidist_linelist_data>)
Assert validity of epidist_linelist_data objects
is_epidist_linelist_data()
Check if data has the epidist_linelist_data class
new_epidist_linelist_data()
Class constructor for epidist_linelist_data objects

Model fitting

Functions for fitting delay distribution models using brms

epidist()
Fit epidemiological delay distributions using a brms interface
epidist(<default>)
Default method used for interface using brms

Naive model

Specific methods for the naive model

as_epidist_naive_model()
Prepare naive model to pass through to brms
as_epidist_naive_model(<epidist_linelist_data>)
The naive model method for epidist_linelist_data objects
is_epidist_naive_model()
Check if data has the epidist_naive_model class
new_epidist_naive_model()
Class constructor for epidist_naive_model objects

Latent model

Specific methods for the latent model

as_epidist_latent_model()
Convert an object to an epidist_latent_model object
as_epidist_latent_model(<epidist_linelist_data>)
The latent model method for epidist_linelist_data objects
epidist_family_model(<epidist_latent_model>)
Create the model-specific component of an epidist custom family
epidist_formula_model(<epidist_latent_model>)
Define the model-specific component of an epidist custom formula
epidist_gen_log_lik_latent()
Create a function to calculate the pointwise log likelihood of the latent model
is_epidist_latent_model()
Check if data has the epidist_latent_model class
new_epidist_latent_model()
Class constructor for epidist_latent_model objects

Postprocess

Functions for postprocessing model output

add_mean_sd()
Add natural scale mean and standard deviation parameters
add_mean_sd(<default>)
Default method for add natural scale parameters
add_mean_sd(<gamma_samples>)
Add natural scale mean and standard deviation parameters for a latent gamma model
add_mean_sd(<lognormal_samples>)
Add natural scale mean and standard deviation parameters for a latent lognormal model
predict_delay_parameters() predict_dpar()
Extract samples of the delay distribution parameters

Diagnostic functions

epidist_diagnostics()
Diagnostics for epidist_fit models

Assert validity of objects

Functions used to assert the validity of package objects

assert_epidist()
Validation for epidist objects

Family

Functions related to specifying custom brms families

epidist_family()
Define epidist family
epidist_family_model() epidist_formula_model()
The model-specific parts of an epidist_family() call
epidist_family_model(<default>)
Default method for defining a model specific family
epidist_family_reparam()
Reparameterise an epidist family to align brms and Stan
epidist_family_reparam(<default>)
Default method for families which do not require a reparameterisation
epidist_family_reparam(<gamma>)
Reparameterisation for the gamma family

Formula

Functions related to specifying custom brms formula

epidist_family_model() epidist_formula_model()
The model-specific parts of an epidist_family() call
epidist_formula()
Define a model specific formula
epidist_formula_model(<default>)
Default method for defining a model specific formula

Prior distributions

Functions for specifying prior distributions

epidist_family_prior()
Family specific prior distributions
epidist_family_prior(<default>)
Default family specific prior distributions
epidist_family_prior(<lognormal>)
Family specific prior distributions for the lognormal family
epidist_model_prior()
Model specific prior distributions
epidist_model_prior(<default>)
Default model specific prior distributions
epidist_prior()
Define prior distributions using brms defaults, model specific priors, family specific priors, and user provided priors

Stan code

Functions for specifying custom Stan code to put into brms

epidist_stancode()
Define model specific Stan code
epidist_stancode(<default>)
Default method for defining model specific Stan code

Generator model functions

Generator functions for creating family specific model utilities.

epidist_gen_posterior_epred()
Create a function to draw from the expected value of the posterior predictive distribution for a latent model
epidist_gen_posterior_predict()
Create a function to draw from the posterior predictive distribution for a latent model

Simulation

Tools for simulating datasets

simulate_exponential_cases()
Simulate exponential cases
simulate_gillespie()
Simulate cases from a stochastic SIR model
simulate_secondary()
Simulate secondary events based on a delay distribution
simulate_uniform_cases()
Simulate cases from a uniform distribution

Data

Data included with the package

sierra_leone_ebola_data
Ebola linelist data from Fang et al. (2016)

Reexported functions

reexports lognormal weibull Gamma bf
Objects exported from other packages