This function is not meant to be used by typical users. It can be used to build custom pipes with estimateR.

do_uncertainty_summary(
  original_values,
  bootstrapped_values,
  uncertainty_summary_method,
  value_col,
  bootstrap_id_col,
  index_col,
  output_Re_only,
  combine_bootstrap_and_estimation_uncertainties = FALSE,
  Re_HPDs = NULL,
  ...
)

Arguments

original_values

Optional. Values of reference used to construct the uncertainty interval around. Typically, these are estimates obtained on the original data. Must be a dataframe with a timestep index column named index_col and a value column named value_col. The index column must not contain any NA value.

bootstrapped_values

Bootstrap replicates of the original data. Must be a dataframe in the long format with a timestep index column named index_col, a bootstrap replicate index column named bootstrap_id_col, and a value column named value_col. The index column must not contain any NA value.

uncertainty_summary_method

One of these options:

  • 'original estimate - CI from bootstrap estimates'. The confidence interval is built using bootstrapped estimates and centered around the original estimates.

  • 'bagged mean - CI from bootstrap estimates'. The confidence interval is built using bootstrapped estimates and centered around the mean of bootstrapped estimates and original estimates.

value_col

string. Name of the column containing values.

bootstrap_id_col

string. Name of the column containing bootstrap samples numbering. Id 0 must correspond to values associated to the original data.

index_col

string. Name of the index column. The index tracks which data point in bootstrapped values corresponds to which data point in the original values.

output_Re_only

boolean. Should the output only contain Re estimates? (as opposed to containing results for each intermediate step)

combine_bootstrap_and_estimation_uncertainties

boolean. Combine uncertainty from Re estimation with uncertainty from observation process? If TRUE, the credible intervals for Re estimates must be passed via Re_HPDs. The output credible intervals will be the union of bootstrapping intervals and Re estimation intervals.

Re_HPDs

Optional. Credible intervals for Re estimates. Use only if combine_bootstrap_and_estimation_uncertainties is TRUE.

...

Arguments passed on to .summarise_CI_bootstrap

central_values

Values around which the confidence interval is going to be centered. Must be a dataframe with a timestep index column named index_col and a value column named value_col. The index column must not contain any NA value.

alpha

value between 0 and 1. Confidence level of the confidence interval.

prefix_up

string. prefix to add to output_value_col to name the column containing the upper limit of confidence interval

prefix_down

string. prefix to add to output_value_col to name the column containing the lower limit of confidence interval

Value

A dataframe containing Re estimates (column 'Re_estimate') and confidence interval boundaries, with 4 columns like so:

  • index_col, the timestep index column

  • A column named output_value_col, containing the central values (typically these are Re estimates)

  • CI_up, upper limit of the confidence interval

  • CI_down, the lower limit of the confidence interval