lundi 25 novembre 2019

Generate/sample random probability mass function (PMF)

It feels it is very easy but I spent the last half an hour trying to find a solution.

What I need to do is to randomly generate/sample the vector (x,y,z) that is a probability mass function, i.e., 0 <= x,y,z <= 1 and x + y + z = 1. And such a vector should be uniformly distributed among all the vectors satisfying the conditions.




Aucun commentaire:

Enregistrer un commentaire