mat_val: Transition matrix validation

Description Usage Arguments Value Examples

View source: R/mat_val.R

Description

Validates a transition matrix. Checks that each entry of the matrix is a non-negative number and that each row add up to 1.

Usage

1

Arguments

M

A candidate transition matrix.

Value

A character string specifing the cause of invalidation, or the matrix itself if it is valid.

Examples

1
2
3
4
5
6
A <- matrix(c(0.33, 0.66, 0.00, 0.00,
               0.16, 0.17, 0.66, 0.00,
               0.50, 0.00, 0.50, 0.00,
               0.00, 0.00, 0.00, 0.00), nrow = 4, byrow = TRUE)
mat_val(A)
mat_val(matrixBuilder(A))

unimi-dse/5547f4ce documentation built on Feb. 17, 2020, 4:03 a.m.