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.

dt

Time interval between assessments.

y0

Initial disease intensity.

r

Apparent infection rate.

n

Number of replicated curves.

alpha

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.01000000
#> 2           1    5 0.01284162 0.01015994
#> 3           1   10 0.01649025 0.01836922
#> 4           1   15 0.02117507 0.02060311
#> 5           1   20 0.02719036 0.04025053
#> 6           1   25 0.03491400 0.03464000
#> 7           1   30 0.04483125 0.05101562
#> 8           2    0 0.01000000 0.01005600
#> 9           2    5 0.01284162 0.01093265
#> 10          2   10 0.01649025 0.01711290
#> 11          2   15 0.02117507 0.01353105
#> 12          2   20 0.02719036 0.03516015
#> 13          2   25 0.03491400 0.03598414
#> 14          2   30 0.04483125 0.06431143
#> 15          3    0 0.01000000 0.01095102
#> 16          3    5 0.01284162 0.01101825
#> 17          3   10 0.01649025 0.01850446
#> 18          3   15 0.02117507 0.01721916
#> 19          3   20 0.02719036 0.02037301
#> 20          3   25 0.03491400 0.03694911
#> 21          3   30 0.04483125 0.04085658
#> 22          4    0 0.01000000 0.01000221
#> 23          4    5 0.01284162 0.01303255
#> 24          4   10 0.01649025 0.01454598
#> 25          4   15 0.02117507 0.01876675
#> 26          4   20 0.02719036 0.02645525
#> 27          4   25 0.03491400 0.04314035
#> 28          4   30 0.04483125 0.03117057