norm_matrix: Row-normalise a matrix with non-negative entries

View source: R/stationarity.R

norm_matrixR Documentation

Row-normalise a matrix with non-negative entries

Description

Row-normalise a matrix with non-negative entries

Usage

norm_matrix(mat)

Arguments

mat

a square matrix with non-negative entries.

Value

a row-stochastic matrix

Examples

M <- matrix(c(124, 3, 16,
        6, 109, 14,
        22, 9, 142),
      ncol = 3, nrow = 3, byrow = TRUE)
norm_matrix(M)

maxbiostat/BinaryMarkovChains documentation built on Dec. 11, 2023, 4:29 a.m.