I want to uniformly sample from a simplex in python. I found the following in R but nothing so far in python
runif_in_simplex(n, simplex)
EDIT: Is the following solution correct?
- generate N random numbers (N = no of vertices of simplex)
- Normalize these N numbers (divide by sum)
- Form the linear combination of N numbers and Vertice's coordinates.
Aucun commentaire:
Enregistrer un commentaire