sim_exponential.Rd
Simulate a stochastic epidemic curve using the Exponential model.
sim_exponential(N = 10,dt = 1, y0 = 0.01, r, n, alpha = 0.2)
N | Total time course of the epidemic |
---|---|
dt | Time step |
y0 | Initial inoculum or initial disease intensity |
r | Infection rate |
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_exponential(N = 30, y0 = 0.01,dt = 5, r = 0.1, alpha = 0.5, n = 4)#> replicates time y random_y #> 1 1 0 0.01000000 0.01000000 #> 2 1 5 0.01648856 0.01000000 #> 3 1 10 0.02718643 0.03493075 #> 4 1 15 0.04482448 0.04179760 #> 5 1 20 0.07390504 0.16265086 #> 6 1 25 0.12185136 0.11946064 #> 7 1 30 0.20090235 0.27018748 #> 8 2 0 0.01000000 0.01014001 #> 9 2 5 0.01648856 0.01036081 #> 10 2 10 0.02718643 0.02975272 #> 11 2 15 0.04482448 0.01000000 #> 12 2 20 0.07390504 0.12806098 #> 13 2 25 0.12185136 0.13118842 #> 14 2 30 0.20090235 0.41914375 #> 15 3 0 0.01000000 0.01237755 #> 16 3 5 0.01648856 0.01063556 #> 17 3 10 0.02718643 0.03548816 #> 18 3 15 0.04482448 0.02388926 #> 19 3 20 0.07390504 0.02758012 #> 20 3 25 0.12185136 0.13960792 #> 21 3 30 0.20090235 0.15637316 #> 22 4 0 0.01000000 0.01000553 #> 23 4 5 0.01648856 0.01710145 #> 24 4 10 0.02718643 0.01917294 #> 25 4 15 0.04482448 0.03207934 #> 26 4 20 0.07390504 0.06890985 #> 27 4 25 0.12185136 0.19362711 #> 28 4 30 0.20090235 0.04785827