sim_gompertz.Rd
Simulate a stochastic epidemic curve using the Gompertz model.
sim_gompertz(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_gompertz(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.0100000 0.01294003 #> 2 1 5 0.3578962 0.39615328 #> 3 1 10 0.7951152 0.88170843 #> 4 1 15 0.9501253 0.94291813 #> 5 1 20 0.9886489 0.99072515 #> 6 1 25 0.9974559 0.99779483 #> 7 1 30 0.9994315 0.99927733 #> 8 2 0 0.0100000 0.01597895 #> 9 2 5 0.3578962 0.49123024 #> 10 2 10 0.7951152 0.85215008 #> 11 2 15 0.9501253 0.98772312 #> 12 2 20 0.9886489 0.99178266 #> 13 2 25 0.9974559 0.99583620 #> 14 2 30 0.9994315 0.99926860 #> 15 3 0 0.0100000 0.01000000 #> 16 3 5 0.3578962 0.30350092 #> 17 3 10 0.7951152 0.74458419 #> 18 3 15 0.9501253 0.95112322 #> 19 3 20 0.9886489 0.98353765 #> 20 3 25 0.9974559 0.99765644 #> 21 3 30 0.9994315 0.99924549 #> 22 4 0 0.0100000 0.01874807 #> 23 4 5 0.3578962 0.44024822 #> 24 4 10 0.7951152 0.86925210 #> 25 4 15 0.9501253 0.95922807 #> 26 4 20 0.9886489 0.99808781 #> 27 4 25 0.9974559 0.99664932 #> 28 4 30 0.9994315 0.99930031