check_trans_prob: Check the transition probabilities for numeric values and...

View source: R/1_model_functions.R

check_trans_probR Documentation

Check the transition probabilities for numeric values and unity row sum

Description

Check the transition probabilities for numeric values and unity row sum

Usage

check_trans_prob(trans_mat)

Arguments

trans_mat

transition matrix

Details

checking for rowsum - checks for the class of transition matrix, value of rowsum (to be 1) and numeric values

Value

0 if they add to 1 else error

Examples

tmat <- rbind(c(1, 2), c(3, 4))
colnames(tmat) <- rownames(tmat) <- c("Healthy", "Dead")
tm <- populate_transition_matrix(2, tmat, list_prob = c(0.5, 0.5, 0, 1))
check_trans_prob(tm)

packDAMipd documentation built on May 29, 2024, 3:18 a.m.