Skip to contents

Two routes. The direct one is beta / gamma. The second matters more than it looks: an outbreak reports a final attack rate, not a transmission rate, and the final-size relation 1 - AR = exp(-R0 AR) inverts it without any dynamic model. It is solved by Newton, which is deterministic, so both language arms land on the same digits.

Usage

R0(beta = NULL, gamma = NULL, attack_rate = NULL, tol = 1e-08, max_iter = 100)

Arguments

beta

Transmission rate.

gamma

Recovery rate, positive.

attack_rate

Final attack rate in (0, 1), used when the rates are unknown.

tol

Newton convergence tolerance.

max_iter

Maximum Newton iterations.

Value

List with estimate, R0, route.

Details

Formula: R0 = beta / gamma; or solve 1 - AR = exp(-R0 AR).

References

Diekmann, O., Heesterbeek, J. A. P. & Metz, J. A. J. (1990). On the definition and the computation of the basic reproduction ratio R0 in models for infectious diseases in heterogeneous populations. Journal of Mathematical Biology 28(4):365-382. doi:10.1007/BF00178324 .

Examples

R0(beta = 0.3, gamma = 0.1)$estimate
#> [1] 3
R0(attack_rate = 0.8)$estimate
#> [1] 2.011797