Build a confidence interval from bootstrapped values

.summarise_CI_bootstrap(
  central_values,
  bootstrapped_values,
  value_col,
  bootstrap_id_col,
  index_col,
  alpha = 0.95,
  prefix_up = "CI_up",
  prefix_down = "CI_down"
)

Arguments

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.

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.

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.

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

dataframe with 4 columns:

  • index_col, the timestep index column

  • value_col, the value input in central_values

  • CI_up, the upper limit of the confidence interval

  • CI_down, the lower limit of the confidence interval