Skip to contents

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

Usage

sim_gompertz(N = 10, dt = 1, y0 = 0.01, r, K = 1, 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.

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.

Value

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

Examples

sim_gompertz(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.01000000
#> 2           1    5 0.02769670 0.03675757
#> 3           1   10 0.06122895 0.05311211
#> 4           1   15 0.11357204 0.10234332
#> 5           1   20 0.18375599 0.21578508
#> 6           1   25 0.26729526 0.21734607
#> 7           1   30 0.35788386 0.42075079
#> 8           2    0 0.01000000 0.01080047
#> 9           2    5 0.02769670 0.02393110
#> 10          2   10 0.06122895 0.06719503
#> 11          2   15 0.11357204 0.11442071
#> 12          2   20 0.18375599 0.21956476
#> 13          2   25 0.26729526 0.26041627
#> 14          2   30 0.35788386 0.29184144
#> 15          3    0 0.01000000 0.01127017
#> 16          3    5 0.02769670 0.02120991
#> 17          3   10 0.06122895 0.07820698
#> 18          3   15 0.11357204 0.09075725
#> 19          3   20 0.18375599 0.14043229
#> 20          3   25 0.26729526 0.17958926
#> 21          3   30 0.35788386 0.35318636
#> 22          4    0 0.01000000 0.01311907
#> 23          4    5 0.02769670 0.03887218
#> 24          4   10 0.06122895 0.09167501
#> 25          4   15 0.11357204 0.14081611
#> 26          4   20 0.18375599 0.18606766
#> 27          4   25 0.26729526 0.25566721
#> 28          4   30 0.35788386 0.31900703