Epidemiological Parameters¶
See also
epi_params.py
Calculate delay distributions and generate delay parameter dictionaries for model building.
-
class
epimodel.pymc3_models.epi_params.
EpidemiologicalParameters
(seed=0, generation_interval=None, incubation_period=None, infection_to_fatality_delay=None, infection_to_reporting_delay=None)¶ Bases:
object
Epidemiological Parameters Class
Wrapper Class, contains information about the epidemiological parameters used in this project.
-
discretise_samples
(samples, max_int)¶ Discretise a set of samples to form a pmf, truncating to max.
- Parameters
samples – Samples to discretize.
max – Truncation.
- Returns
pmf - discretised distribution.
-
generate_dist_samples
(dist, nRVs, with_noise)¶ Generate samples from given distribution.
- Parameters
dist – Distribution dictionary to use.
nRVs – number of random variables to sample
with_noise – if true, add noise to distributions, else do not.
- Returns
samples
-
generate_gi
(with_noise=True)¶ Generate generation interval parameters.
Note: this uses the random seed associated with the EpidemiologicalParameters() object, and will be consistent.
- Param
with_noise: boolean - if True, add noise to estimates
- Returns
Mean, sd of generation interval.
-
generate_pmf_statistics_str
(delay_prob)¶ Make mean and variance of delay string.
- Parameters
delay_prob – delay to compute statistics of.
- Returns
Information string.
-
generate_reporting_and_fatality_delays
(nRVs=10000000, with_noise=True, max_reporting=32, max_fatality=48)¶ Generate reporting and fatality discretised delays using Monte Carlo integration.
Note: this uses the random seed associated with the EpidemiologicalParameters() object, and will be consistent.
- Parameters
nRVs – int - number of random variables used for integration
max_reporting – int - reporting delay truncation
with_noise – boolean. If true, use noisy values for the incubation period etc, otherwise use the means.
max_fatality – int - death delay trunction
- Returns
reporting_delay, fatality_delay tuple
-
get_model_build_dict
()¶ Grab parameters which can be conveniently passed to our model files.
- Returns
param dict
-
summarise_parameters
()¶ Print summary of parameters.
-
-
epimodel.pymc3_models.epi_params.
bootstrapped_negbinom_values
(delays, n_bootstrap=250, n_rvs=10000000, truncation=64, filter_disp_outliers=True)¶ Fit negative binomial to n_bootstrapped sets of n_rv samples, each set of samples drawn randomly from the priors placed on the distributions in the delay array. e.g., this function is used to fit a single negative binomial distribution (with uncertainty) to the sum of the incubation period and onset to death delay.
- Parameters
delays – list of distributions (with uncertainty), used to produce estimates.
n_bootstrap – number of bootstrapped to perform
n_rvs – number of samples to draw from each draw from prior
truncation – maximum value to truncate to.
- Returns
dictionary with uncertain NB values
-
epimodel.pymc3_models.epi_params.
ci_to_mean_sd
(mean, ci, percent=0.95)¶