powered by
Simulate epidemiological data
sim_epi_data(S0, I0, max_time, beta_vec, xi_0, user_seed = 1234L)
Function sim_epi_data returns a vector with the simulated infection times.
sim_epi_data
number of individuals in the population.
number of infected individuals at time 0.
maximum observed time.
vector with the infection rate for each discrete time.
the recovery rate of the population, must be in \((0,1)\).
seed for random distribution generation.
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