Skip to contents

Calculate a growth rate from a reproduction number and an infectivity profile

Usage

inv_wallinga_lipsitch(
  Rt,
  y = i_empirical_ip,
  a1 = seq(0.5, length.out = length(y)),
  a0 = dplyr::lag(a1, default = 0)
)

Arguments

Rt

a vector of reproduction numbers

y

an empirical infectivity profile as a probability vector or as a dataframe of format: A dataframe containing the following columns:

  • boot (anything + default(1)) - a bootstrap identifier

  • probability (proportion) - the probability of new event during this period.

  • a0 (double) - the beginning of the time period (in days)

  • a1 (double) - the end of the time period (in days)

Minimally grouped by: boot (and other groupings allowed). A default value is defined.

a1

the end time of the infectivity profile probability estimate (defaults to 0.5,1.5,2.5,...).

a0

the start time of the infectivity profile probability estimate (defaults to 0,0.5,1.5,...).

Value

an vector of growth rates

Examples

y=stats::pgamma(seq(0.5,length.out=50), 5,2)-stats::pgamma(c(0,seq(0.5,length.out=49)), 5,2)
inv_wallinga_lipsitch(Rt=seq(0.5,2.5,length.out=9), y=y)
#> [1] -0.2569485 -0.1113906  0.0000000  0.0915073  0.1698742  0.2387815  0.3005553
#> [8]  0.3567320  0.4083300