Calculate basic reproduction number R0

facilityR0(S, C, A, transm, initS, mgf = NULL)

Arguments

S

A matrix of state transition rates between and removal from the susceptible states in the absence of colonized individuals

C

A matrix of state transition rates between and removal from the colonized states

A

A matrix describing transitions from susceptible to colonized states at acquisition

transm

A vector of transmission rates from each colonized state

initS

A vector of admission state probabilities to each susceptible state

mgf

The moment generating function characterizing the time-of-stay-dependent removal hazard

Value

A number (R0)

Examples

S <- rbind(c(-1,2),c(1,-2))
C <- rbind(c(-1.1,0),c(0.1,-0.9))
A <- rbind(c(1,0),c(0,2))
transm <- c(0.4,0.6)
initS <- c(0.9,0.1)
mgf <- function(x, deriv=0) MGFgamma(x, rate=0.01, shape=3.1, deriv)
facilityR0(S,C,A,transm,initS,mgf)
#> [1] 0.7244774