Simulate disease progress data under the logistic epidemic model, with optional replicated observations.
Arguments
- N
Total epidemic duration. Must be positive.
- dt
Time interval between assessments. Must be positive and less than or equal to `N`.
- y0
Initial disease intensity as a proportion, strictly between 0 and 1.
- r
Apparent infection rate. Must be positive.
- K
Maximum disease intensity as a proportion. Must be greater than or equal to `y0` and less than or equal to 1.
- n
Number of replicated curves. Must be a positive whole number.
- alpha
Non-negative noise level applied to replicated observations.
Examples
sim_logistic(N = 30, dt = 5, y0 = 0.01, r = 0.05, K = 1, n = 4)
#> replicates time y random_y
#> 1 1 0 0.01000000 0.01193947
#> 2 1 5 0.01280525 0.01344186
#> 3 1 10 0.01638399 0.01848616
#> 4 1 15 0.02094122 0.01554351
#> 5 1 20 0.02673115 0.02868450
#> 6 1 25 0.03406581 0.03277957
#> 7 1 30 0.04332302 0.04554951
#> 8 2 0 0.01000000 0.01048391
#> 9 2 5 0.01280525 0.01272673
#> 10 2 10 0.01638399 0.01672375
#> 11 2 15 0.02094122 0.01901935
#> 12 2 20 0.02673115 0.02157482
#> 13 2 25 0.03406581 0.04644417
#> 14 2 30 0.04332302 0.04485410
#> 15 3 0 0.01000000 0.01000000
#> 16 3 5 0.01280525 0.01286273
#> 17 3 10 0.01638399 0.01900716
#> 18 3 15 0.02094122 0.02310570
#> 19 3 20 0.02673115 0.03134748
#> 20 3 25 0.03406581 0.03158061
#> 21 3 30 0.04332302 0.04426866
#> 22 4 0 0.01000000 0.01000000
#> 23 4 5 0.01280525 0.01468549
#> 24 4 10 0.01638399 0.01352917
#> 25 4 15 0.02094122 0.02228050
#> 26 4 20 0.02673115 0.01784140
#> 27 4 25 0.03406581 0.02315644
#> 28 4 30 0.04332302 0.03855410
