Learn R Programming

facilityepimath (version 0.1.0)

equilib: Calculate the equilibrium of a linear facility model

Description

Calculate the equilibrium of a linear facility model

Usage

equilib(M, init, mgf = NULL)

Value

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

Arguments

M

A matrix of state transition rates between facility patient states

init

A vector of admission state probabilities to each state

mgf

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

Examples

Run this code
M <- rbind(c(-0.06,0.03,0),c(0.06,-0.08,0),c(0,0.05,0))
init <- c(0.95,0.05,0)
mgf <- function(x, deriv=0) MGFgamma(x, rate = 0.05, shape = 2.5, deriv)
equilib(M, init, mgf)

Run the code above in your browser using DataLab