Skip to contents

Draw from the Serial Interval Probability Distribution

Usage

draw_from_si_prob(days_ago = NULL, serial_interval = NULL)

Arguments

days_ago

Numeric vector of days in the past. Defaults to NULL.

serial_interval

A numeric vector describing the probability distribution the serial interval. See EpiNow::covid_serial_interval for an example of the format.

Value

A draw from the probability distribution the serial interval.

Examples


## Draw
draw_from_si_prob(rev(c(1, 2, 4, 10, 1:100)), EpiSoon::example_serial_interval)
#>                                                                                 
#> 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 
#>                                                                                 
#> 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 
#>                                                                                 
#> 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 
#>                                                                                 
#> 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 
#>                                                                                 
#> 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 
#>                                      14   12   11   10    9    8    7    6    5 
#> 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.01 0.01 0.01 0.02 0.03 0.05 0.05 0.13 0.15 
#>    4    3    2    1   10    4    2    1 
#> 0.09 0.17 0.25 0.03 0.02 0.09 0.25 0.03