Calculate the equilibrium of a facility transmission model

facilityeq(S, C, A, R, transm, init, 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

R

A matrix of recovery rates: state transition rates from colonized to susceptible states

transm

A vector of transmission rates from each colonized state

init

A vector of admission state probabilities to each state

mgf

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

Value

A vector with the proportion of patients in each state at equilibrium

Examples

S <- 0
C <- rbind(c(-0.38,0),c(0.08,0))
A <- rbind(1,0)
R <- cbind(0.3,0)
transm <- c(0.1,0.05)
init <- c(0.99,0.01,0)
mgf <- function(x, deriv=0) MGFgamma(x, rate=0.2, shape=3, deriv)
facilityeq(S, C, A, R, transm, init, mgf)
#> [1] 0.995173460 0.002477948 0.002348593