R/02_decision_model_functions.R
check_sum_of_transition_array.Rdcheck_sum_of_transition_array checks if each of the rows of the
transition matrices sum to one.
A transition probability array.
Number of health states. Defaults to the first dimension of
a_P.
Number of cycles. Defaults to the third dimension of a_P.
Logical variable to stop model run if set up as TRUE. Default = FALSE.
Logical variable to indicate print out of messages. Default = FALSE
Numeric tolerance for the comparison of each row sum with one. Default = 1e-08.
Invisibly, a data frame with one row per row of a_P whose transition
probabilities do not sum to one, empty when the array is valid. With
err_stop = TRUE the function stops instead, and with
verbose = TRUE it warns, listing the offending rows and cycles.
l_params_all <- load_all_params()
a_P <- decision_model(l_params_all)$a_P
check_sum_of_transition_array(a_P, verbose = TRUE)