Skip to contents

Calculate a reproduction number estimate from growth rate using the Wallinga 2007 estimation using empirical generation time distribution. This uses resampling to transmit uncertainty in growth rate estimates

Usage

rt_from_growth_rate(
  df = i_growth_rate,
  ip = i_infectivity_profile,
  bootstraps = 2000
)

Arguments

df

Growth rate estimates

A dataframe containing the following columns:

  • time (as.time_period + group_unique) - A (usually complete) set of singular observations per unit time as a `time_period`

  • growth.fit (double) - an estimate of the growth rate

  • growth.se.fit (double) - the standard error the growth rate

  • growth.0.025 (double) - lower confidence limit of the growth rate

  • growth.0.5 (double) - median estimate of the growth rate

  • growth.0.975 (double) - upper confidence limit of the growth rate

No mandatory groupings.

No default value.

ip

Infectivity profile

A dataframe containing the following columns:

  • boot (anything) - a bootstrap identifier

  • time (positive_double) - the end of the time period (in days)

  • probability (proportion) - the probability of infection between previous time period until `time`

Must be grouped by: boot (exactly).

A default value is defined.

bootstraps
  • the number of bootstraps to take to calculate for each point.

Value

A dataframe containing the following columns:

  • time (as.time_period + group_unique) - A (usually complete) set of singular observations per unit time as a time_period

  • rt.fit (double) - an estimate of the reproduction number

  • rt.se.fit (double) - the standard error of the reproduction number

  • rt.0.025 (double) - lower confidence limit of the reproduction number

  • rt.0.5 (double) - median estimate of the reproduction number

  • rt.0.975 (double) - upper confidence limit of the reproduction number

No mandatory groupings.

No default value.

Examples

tmp = growthrates::england_covid %>%
  time_aggregate(count=sum(count))


if (FALSE) {
  # not run
  tmp2 = tmp %>%
    poisson_locfit_model() %>%
    rt_from_growth_rate()
}