getInfectedPerDay: getInfectedPerDay

View source: R/getInfectedPerDay.R

getInfectedPerDayR Documentation

getInfectedPerDay

Description

Generate Poisson distributed infections. This function calculates n, the number of days between StartDate and EndDate, and returns a vector with n realizations of a Poisson(lambda) distributed random variable.

Usage

getInfectedPerDay(lambda = 4, StartDate = "2020-03-03", EndDate = "2020-06-24")

Arguments

lambda

Expected number of infections/day.

StartDate

Day, simulation starts

EndDate

Day, simulation ends

Value

This function returns a vector that lists the number of infections.

Examples

StartDate <- "2020-03-03"
EndDate <- "2020-06-24"
getInfectedPerDay(lambda = 4, StartDate = StartDate, EndDate = EndDate)

babsim.hospital documentation built on May 30, 2022, 9:05 a.m.