run_sim: Negative binomial branching process model

Description Usage Arguments Value Author(s) Examples

View source: R/run_sim.R

Description

Negative binomial branching process model

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
run_sim(
  n,
  n_length,
  mean_si,
  sd_si,
  serial_fn = NULL,
  R0,
  k = 0.16,
  tf = 37,
  kept_times = NULL,
  max_potential_cases,
  delay_sample
)

Arguments

n

Numeric, number of initial cases

n_length

Numeric, the number of days in the initial seeding event

mean_si

Numeric, the mean of the serial interval

sd_si

Numeric, the sd of the serial interval

serial_fn

Function from which to sample the serial interval must accepted a number of samples argument followed by a mean and standard deviation. If missing defaults to a normal distribution.

R0

Numeric, the estimated reproduction number

k

Numeric, the dispersion of the negative binomial branching process

tf

Numeric, the end time of the branching process

kept_times

Numeric, a vector of timepoints to keep information on. Defaults to all time points

max_potential_cases

Numeric, the maximum number of cases

delay_sample

A function to sample from reporting delays

Value

A dataframe containing the simulation time and outbreak size

Author(s)

Sebastian Funk, Sam Abbott, James Munday

Examples

1
2
3
4
5
6
7
8
## Example

run_sim(n = 1, n_length = 7, mean_si = 5, sd_si = 2, R0 = 2, 
        k=0.16, tf=37, max_potential_cases= 100, 
        delay_sample = function(x) {rnorm(x, 6, 1)})
        
## Code
run_sim

epiforecasts/WuhanSeedingVsTransmission documentation built on Feb. 12, 2020, 9:30 p.m.