Learn R Programming

facilityepimath (version 0.1.0)

meanlengthofstay: Calculate the mean length of stay for a linear facility model

Description

Calculate the mean length of stay for a linear facility model

Usage

meanlengthofstay(M, init, mgf)

Value

The mean length of stay

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(-1.1,2),c(1,-2.2))
init <- c(0.9,0.1)
mgf <- function(x, deriv=0) MGFgamma(x, rate=0.2, shape=3, deriv)
meanlengthofstay(M, init, mgf)

Run the code above in your browser using DataLab