Rev Language Reference


stochasticMatrix - Building a stochastic matrix.

A stochastic matrix is a matrix (not necessarily square) with rows that sum to 1.

Usage

stochasticMatrix(Simplex[] x)

Arguments

x : Simplex[] (pass by const reference)
A vector of simplices. Each simplex corresponds to a row in the stochastic matrix.

Return Type

Example

vec[1] ~ dnDirichlet( [1,1,1,1] )
vec[2] ~ dnDirichlet( [1,1,1,1] )
vec[3] ~ dnDirichlet( [1,1,1,1] )
vec[4] ~ dnDirichlet( [1,1,1,1] )

m := stochasticMatrix(vec)