Learn R Programming

BayesChange (version 2.1.3)

sim_epi_data: Simulate epidemiological data

Description

Simulate epidemiological data

Usage

sim_epi_data(S0, I0, max_time, beta_vec, xi_0, user_seed = 1234L)

Value

Function sim_epi_data returns a vector with the simulated infection times.

Arguments

S0

number of individuals in the population.

I0

number of infected individuals at time 0.

max_time

maximum observed time.

beta_vec

vector with the infection rate for each discrete time.

xi_0

the recovery rate of the population, must be in \((0,1)\).

user_seed

seed for random distribution generation.

Examples

Run this code

betas <- c(rep(0.45, 25),rep(0.14,25))

inf_times <- as.numeric()

inf_times <- sim_epi_data(10000, 10, 50, betas, 1/8)

Run the code above in your browser using DataLab