check_trans_prob: Check the tranisition probabilties row sum is 1

Description Usage Arguments Value Examples

View source: R/model_functions.R

Description

Check the tranisition probabilties row sum is 1

Usage

1
check_trans_prob(trans_mat)

Arguments

trans_mat

transition matrix

Value

rowsum if they add upto 1 else error

Examples

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

sheejamk/MarkovModel documentation built on Jan. 23, 2020, 2:44 a.m.