runif_unitSimplex: Uniform sampling on/in a unit simplex

runif_unitSimplexR Documentation

Uniform sampling on/in a unit simplex

Description

Uniform sampling on or in a unit simplex (arbitrary dimension).

Usage

runif_on_unitSimplex(n, d)

runif_in_unitSimplex(n, d)

Arguments

n

number of simulations

d

dimension of the space

Value

The simulations in a n times d matrix.

See Also

runif_in_tetrahedron for sampling in an arbitrary tetrahedron in dimension 3; runif_in_simplex for sampling in an arbitrary simplex.

Examples

library(rgl)
sims <- runif_on_unitSimplex(300, d = 3)
points3d(sims)

uniformly documentation built on July 26, 2023, 6:06 p.m.