mdp_check_square_stochastic: Checks if a matrix is square and stochastic

Description Usage Arguments Details Value Examples

Description

Checks whether a matrix is square and stochastic

Usage

1

Arguments

X

a matrix

Details

mdp_check_square_stochastic checks if the matrix (X) is square and stochastic (sums of rows equal to 1). If it is the case, the function returns an empty error message. In the opposite case, the function returns an error message describing the problem.

Value

Returns a character string which is empty if the matrix is square and stochastic. In the opposite case, the variable contains problem information.

Examples

1
2
3
M <- matrix(c(0.6116, 0.3884, 0, 1.0000), 2, 2, byrow=TRUE)

mdp_check_square_stochastic(M)

Example output

Loading required package: Matrix
Loading required package: linprog
Loading required package: lpSolve
[1] ""

MDPtoolbox documentation built on May 2, 2019, 2:10 p.m.