simulate_poisson: Simulate a partially observed Poisson branching process with...

Description Usage Arguments Value Author(s) Examples

View source: R/simulate_poisson.R

Description

For a given reproduction number, this function simulate the incidence of a disease at each generation. The offspring distribution of each individual infected is assumed to follow a Poisson distribution with mean equal to the reproduction number. To simulate under-reporting, users can specify a probability to observe case, this reporting probability is assumed constant through the simulation.

Usage

1
simulate_poisson(R, n, s, rho, t_max)

Arguments

R

is the reproduction number, i.e. the average number of secondary cases due to a single case. This can be any positive number. if R is a vector, then the length of R must be 'n' (see below).

n

is the number of simulations performed. Each simulation start with 's' individual(s) infected. 'n' must be a positive integer.

s

is the number individual(s) initially infected. if s is a vector, then the length of s must be 'n' (see above).

rho

is the probability (between 0 and 1) that an incident case is observed, i.e. reporting probability. if rho is a vector, then the length of rho must be 'n' (see below)

t_max

is the maximum number of generations simulated. 't_max' must be a positive integer.

Value

The function returns a list including:

Note that if some simulated outbreaks are not extinct by the end of the simulation, a warning is displayed.

Author(s)

Pierre Nouvellet (p.nouvellet@imperial.ac.uk)

Examples

1
2
x <- simulate_poisson(.9, 5, 1, .5, 1e2)
x

reconhub/branchr documentation built on May 27, 2019, 4:01 a.m.