Skip to contents

All functions

add_pmfs()
Add probability mass functions
add_time_indexing()
Add time indexing to count data
assert_cols_det_unique_row()
Check a set of columns in a data frame uniquely identify data frame rows.
assert_daily_data()
Assert that the vector of dates being passed in contains dates for each day
assert_dates_within_frame()
Assert that the second vector of dates is within the period after the first date in the first set of dats and the maximum date
assert_df_not_empty()
Assert that the dataframe being passed to the function is not empty
assert_elements_non_neg()
Assert that all elements of a vector are non-negative
assert_equivalent_indexing()
Assert that two tibbles of date and time mapping align
assert_int_or_char()
Assert that a vector is either of a vector of integers or a vector of characters
assert_no_dates_after_max()
Check that all dates in dataframe passed in are before a specified date
assert_no_repeated_elements()
Check that there are no repeated elements in the vector
assert_non_missingness()
Assert that there is no missignness in a particular vector
assert_req_count_cols_present()
Check that the input count data contains all the required column names
assert_req_ww_cols_present()
Check that the input wastewater data contains all the required column names
assert_rt_correct_length()
Assert that R(t) specified for generating simulated data is of sufficient length
assert_single_value()
Assert that there is only a single value in a particular column
assert_site_lab_indices_align()
Assert that the specified site and lab indices line up
assert_sufficient_days_of_data()
Assert that the vector of dates spans at least the specified calibration time
assert_ww_site_pops_lt_total()
Assert that the sum of the wastewater site populations don't exceed the total population
autoescape_brackets()
Escape brackets returned in a string for passing to glue
calc_rt()
Back- calculate R(t) from incident infections and the generation interval
compile_model()
Compile a stan model while pointing at the package default include directory (stan) for #include statements
convert_to_logmean()
Get the mean of a Normal distribution for a random variable Y needed to ensure that the distribution of X = exp(Y) (which is Log-Normal) has a specified mean and sd.
convert_to_logsd()
Get the sd of a Normal distribution for a random variable Y needed to ensure that the distribution of X = exp(Y) (which is Log-Normal) has a specified mean and sd.
create_dir()
Create a new directory if one doesn't exist
create_site_lab_map()
Create a mapping of sites, labs, and population sizes in each site
default_covid_gi
COVID-19 post-Omicron generation interval probability mass function
default_covid_inf_to_hosp
COVID-19 time delay distribution from infection to hospital admission
downsample_ww_obs()
Downsample the predicted wastewater concentrations based on the lab site reporting frequency and lab site reporting latencyy
drop_first_and_renormalize()
Drop the first element of a simplex and re-normalize the result to sum to 1.
flag_ww_outliers()
Flag WW outliers
format_hosp_data()
Format the hospital admissions data into a tidy dataframe
format_ww_data()
Format the wastewater data as a tidy data frame
generate_simulated_data()
Generate simulated data from the underlying model's generative process
get_count_data_sizes()
Get count data integer sizes for stan
get_count_indices()
Get count data indices
get_count_values()
Get count values
get_draws() get_draws_df() plot(<wwinference_fit_draws>)
Postprocess to generate a draws dataframe
get_global_rt()
Function to generate a global weekly R(t) estimate with added noise
get_ind_m()
Get index matrix
get_inits_for_one_chain()
Given a set of prior parameters and stan data, initialize the model near the center of the prior distribution
get_input_count_data_for_stan()
Get the input count data to pass directly to stan
get_input_ww_data_for_stan()
Get the input ww data passed directly to stan
get_mcmc_options()
Get MCMC options
get_model_diagnostic_flags()
Get a table of diagnostic flags
get_model_spec()
Get model specifications
get_params()
Get parameters for model run
get_plot_forecasted_counts()
Get plot of fit and forecasted counts
get_plot_global_rt()
Get plot of fit, nowcasted, and forecasted "global" R(t)
get_plot_subpop_rt()
Get plot of fit, nowcasted, and forecasted R(t) in each subpopulation
get_plot_ww_conc()
Get plot of fit and forecasted wastewater concentrations
get_pred_obs_conc()
Get the predicted concentrations in each lab site
get_pred_subpop_gen_per_n()
Get the predicted genomes per person in each subpopulation
get_stan_data()
Get stan data for ww + hosp model
get_subpop_data()
Get subpopulation data
get_time_varying_daily_ihr()
Get time varying IHR
get_ww_data_indices()
Get wastewater data indices
get_ww_data_sizes()
Get the integer sizes of the wastewater input data
get_ww_values()
Get wastewater data values
hosp_data
Example hospital admissions dataset
hosp_data_eval
Example hospital admissions dataset for evaluation
indicate_ww_exclusions()
Indicate data that we want to exclude from model fitting
make_hospital_onset_delay_pmf()
Make hospital onset delay pmf
make_incubation_period_pmf()
Make incubation period pmf
make_reporting_delay_pmf()
Make reporting delay pmf
parameter_diagnostics()
Method for printing the CmdStan parameter diagnostics for a wwinference_fit_object
preprocess_count_data()
Pre-process hospital admissions data, converting column names to those that get_stan_data() expects.
preprocess_ww_data()
Pre-process wastewater input data, adding needed indices and flagging potential outliers
simulate_double_censored_pmf()
Simulate daily double censored PMF. From epinowcast: https://package.epinowcast.org/dev/reference/simulate_double_censored_pmf.html #nolint
subpop_inf_process()
Get the subpopulation level incident infections
subpop_rt_process()
Get subpopulation level R(t) estimates assuming time and space independence
throw_type_error()
Throw an informative type error on a user-provided input
to_simplex()
Normalize vector to a simplex
true_global_rt
Global R(t) estimate dataset
validate_both_datasets()
Validate that both count data and wastewater data are coherent and compatible with one another and the the user-specified parameters
validate_count_data()
Validate user-provided count data
validate_paramlist()
Validate a parameter list
validate_pmf()
Validate that the pmf vector being passed to stan is a valid probability mass function. It must sum to 1 and have all non-negative entries.
validate_ww_conc_data()
Validate user-provided wastewater concentration data
ww_data
Example wastewater dataset.
wwinference() print(<wwinference_fit>) summary(<wwinference_fit>)
Joint inference of count data (e.g. cases/admissions) and wastewater data