mkStochastic function

mkStochastic ensures that it is a stochastic vector, matrix or array.

mkStochastic ensures that it is a stochastic vector, matrix or array.

mkStochastic(M)

Arguments

  • M: A vector, matrix or array to transform.

Returns

A vector, matrix or array for which the sum over the last dimension is 1.

Details

mkStochastic ensures that the giving argument is a stochastic vector, matrix or array, i.e., that the sum over the last dimension is 1.

  • Maintainer: Florian Lecocq
  • License: GPL (>= 3)
  • Last published: 2019-08-06