sim_logistic.Rd
Simulate a stochastic epidemic curve using the logistic model.
sim_logistic(N = 10,dt = 1, y0 = 0.01, r, K = 1, n, alpha = 0.2)
N | Total time course of the epidemic |
---|---|
dt | Time step |
y0 | Initial inoculum or initial disease intensity |
r | Infection rate |
K | Maximum asymptote |
n | Number or replicates or sample size for each time step |
alpha | Variation parameter. stands for the variation for the replicates for each time step. The standard deviation is calculated as sd = alpha * y * (1 - y), being y the disease intensity for each time step. |
Replicates
Time after epidemic start
Disease intensity
Disease intensity after applying the random alpha
error
sim_logistic(N = 30, y0 = 0.01,dt = 5, r = 0.3, K = 1, alpha = 0.5, n = 4)#> replicates time y random_y #> 1 1 0 0.01000000 0.01708980 #> 2 1 5 0.04331353 0.02983192 #> 3 1 10 0.16868040 0.15414018 #> 4 1 15 0.47626911 0.42727873 #> 5 1 20 0.80297496 0.77766254 #> 6 1 25 0.94809157 0.94122344 #> 7 1 30 0.98793024 0.99087661 #> 8 2 0 0.01000000 0.01000000 #> 9 2 5 0.04331353 0.03283073 #> 10 2 10 0.16868040 0.26284577 #> 11 2 15 0.47626911 0.44950711 #> 12 2 20 0.80297496 0.78877148 #> 13 2 25 0.94809157 0.94562618 #> 14 2 30 0.98793024 0.99217919 #> 15 3 0 0.01000000 0.01000000 #> 16 3 5 0.04331353 0.04253380 #> 17 3 10 0.16868040 0.12088669 #> 18 3 15 0.47626911 0.43582664 #> 19 3 20 0.80297496 0.80773384 #> 20 3 25 0.94809157 0.93360066 #> 21 3 30 0.98793024 0.99109904 #> 22 4 0 0.01000000 0.01000000 #> 23 4 5 0.04331353 0.04966502 #> 24 4 10 0.16868040 0.06095428 #> 25 4 15 0.47626911 0.43873185 #> 26 4 20 0.80297496 0.76118639 #> 27 4 25 0.94809157 0.93204550 #> 28 4 30 0.98793024 0.98759102