Skip to contents

Simulate disease progress data under the exponential epidemic model, with optional replicated observations.

Usage

sim_exponential(N = 10, dt = 1, y0 = 0.01, r, n, alpha = 0.2)

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.

n

Number of replicated curves. Must be a positive whole number.

alpha

Non-negative noise level applied to replicated observations.

Value

A data frame with simulated disease progress values and replicated noisy observations.

Examples

sim_exponential(N = 30, dt = 5, y0 = 0.01, r = 0.05, n = 4)
#>    replicates time          y   random_y
#> 1           1    0 0.01000000 0.01179780
#> 2           1    5 0.01284162 0.01018958
#> 3           1   10 0.01649025 0.01988401
#> 4           1   15 0.02117507 0.01920223
#> 5           1   20 0.02719036 0.03054428
#> 6           1   25 0.03491400 0.05103115
#> 7           1   30 0.04483125 0.04256408
#> 8           2    0 0.01000000 0.01149272
#> 9           2    5 0.01284162 0.01691009
#> 10          2   10 0.01649025 0.01741901
#> 11          2   15 0.02117507 0.01386981
#> 12          2   20 0.02719036 0.02947986
#> 13          2   25 0.03491400 0.02594200
#> 14          2   30 0.04483125 0.04846053
#> 15          3    0 0.01000000 0.01000000
#> 16          3    5 0.01284162 0.01168923
#> 17          3   10 0.01649025 0.01152340
#> 18          3   15 0.02117507 0.01704291
#> 19          3   20 0.02719036 0.02773135
#> 20          3   25 0.03491400 0.02820894
#> 21          3   30 0.04483125 0.06377067
#> 22          4    0 0.01000000 0.01000000
#> 23          4    5 0.01284162 0.01876478
#> 24          4   10 0.01649025 0.01798649
#> 25          4   15 0.02117507 0.02236905
#> 26          4   20 0.02719036 0.03113404
#> 27          4   25 0.03491400 0.04275928
#> 28          4   30 0.04483125 0.04788343