get_bootstrap_replicate.Rd
Apply a bootstrapping procedure on incidence data. Estimating Re over many bootstrapped replicates allows one to estimate the uncertainty over the estimated Re value due to observation noise. For now, only a non-parametric block bootstrapping function is implemented.
get_bootstrap_replicate( incidence_data, bootstrapping_method = "non-parametric block boostrap", simplify_output = TRUE, ... )
incidence_data | An object containing incidence data through time. It can either be:
|
---|---|
bootstrapping_method | string. Method to perform bootstrapping of the original incidence data. Available options are:
|
simplify_output | boolean. Return a numeric vector instead of module output object if output offset is zero? |
... | Arguments passed on to
|
A list with two elements:
A numeric vector named values
: the result of the computations on the input data.
An integer named index_offset
: the offset, counted in number of time steps,
by which the result is shifted compared to an index_offset
of 0
.
This parameter allows one to keep track of the date of the first value in values
without needing to carry a date
column around.
A positive offset means values
are delayed in the future compared to the reference values.
A negative offset means the opposite.
Note that the index_offset
of the output of the function call
accounts for the (optional) index_offset
of the input.
If index_offset
is 0
and simplify_output = TRUE
,
the index_offset
is dropped and the values
element is returned as a numeric vector.
## Basic usage of get_bootstrap_replicate bootstrap_replicate_1 <- get_bootstrap_replicate( HK_incidence_data$case_incidence ) ## Advanced usage of get_bootstrap_replicate # Generate a bootstrap replicate of the incidence data, where case numbers are # allowed to be decimal numbers, and the output is return as a list. bootstrap_replicate_2 <- get_bootstrap_replicate( HK_incidence_data$case_incidence, simplify_output = FALSE, round_incidence = FALSE )