Seed_finder: Find a seed for the desired outbreak size

Description Usage Arguments Value Examples

View source: R/Seed_finder.R

Description

Runs a series of independent simulations for a series of seeds, and outputs a seed(s) that give a desired final size, as well as a histogram of all final sizes.

Usage

1
Seed_finder(model, N, ..., betas, ds, size, error, seeds)

Arguments

model

Takes values "Unif", "Clust", "Edge", "Latt", "Lines", or "Trials", corresponding to the appropriate distance matrix function.

N

The population size.

...

The parameters of the specifief distance matrix function (see example).

betas

A vector of infection rates, used for the Beta_mat_form function.

ds

A vector of distances at which the infection rate changes, used for the Beta_mat_form function.

size

The final size of the epidemic that is desired (total number infected).

error

The allowed error on the final size above and below.

seeds

The number of seeds desired to be tested. Always iterates from 1:seeds.

Value

A histogram of the final size of all tested simulations, and a table of seeds and final sizes that fit the requirements.

Examples

1
2
3
4
Seed_finder("Clust", 
            N=100, xlim = 20, ylim = 20, centres = 5, spread = 1, 
            betas = c(0.1, 0.001), ds = 0.25, 
            size = 25, error = 2, seeds = 250)

BenjamenSimon/EpidemicR documentation built on March 23, 2020, 11:03 p.m.