estimate_peak {incidence2}R Documentation

Estimate the peak date of an incidence curve

Description

This function can be used to estimate the peak of an epidemic curve using bootstrapped samples of the available data.

Usage

estimate_peak(x, n = 100L, alpha = 0.05, first_only = TRUE, progress = TRUE)

Arguments

x

An incidence2 object.

n

integer.

The number of bootstrap datasets to be generated; defaults to 100.

⁠[double]⁠ vectors will be converted via as.integer(n).

alpha

numeric.

The type 1 error chosen for the confidence interval; defaults to 0.05.

first_only

bool.

Should only the first peak (by date) be kept.

Defaults to TRUE.

progress

bool.

Should a progress bar be displayed (default = TRUE)

Details

Input dates are resampled with replacement to form bootstrapped datasets; the peak is reported for each, resulting in a distribution of peak times. When there are ties for peak incidence, only the first date is reported.

Note that the bootstrapping approach used for estimating the peak time makes the following assumptions:

Value

A data frame with the the following columns:

Author(s)

Thibaut Jombart and Tim Taylor, with inputs on caveats from Michael Höhle.

See Also

bootstrap_incidence() for the bootstrapping underlying this approach and keep_peaks() to get the peaks in a single incidence2 object.

Examples


if (requireNamespace("outbreaks", quietly = TRUE)) {

  # load data and create incidence
  data(fluH7N9_china_2013, package = "outbreaks")
  i <- incidence(fluH7N9_china_2013, date_index = "date_of_onset")

  # find 95% CI for peak time using bootstrap
  estimate_peak(i)
}



[Package incidence2 version 2.3.1 Index]