powered by
This function checks if x is a tpm (transition probability matrix).
x
is_tpm(x)
Either TRUE or FALSE.
TRUE
FALSE
A matrix.
matrix
if (FALSE) { is_tpm(diag(2)) is_tpm(matrix(1, 2, 2)) }
Run the code above in your browser using DataLab