Skip to contents

Is object a transition probability matrix?

Usage

is_prob_matrix(probs, dp = 5)

Arguments

probs

matrix of transition probabilities

dp

Decimal places; Tolerance for equivalence

Value

logical

Examples

if (FALSE) {
probs <- matrix(c(1,0,0,1), nrow = 2)
is_prob_matrix(probs)

probs <- matrix(c(2,0,-1,1), nrow = 2)
assert_that(is_prob_matrix(probs))
}