direct_sampling | R Documentation |
The d
-dimensional unit simplex is the set of points \vec{x}\in \R^d
, s.t.: \sum_i x_i\leq 1
, x_i\geq 0
. The d
-dimensional canonical simplex is the set of points \vec{x}\in \R^d
, s.t.: \sum_i x_i = 1
, x_i\geq 0
.
direct_sampling(body, n)
body |
A list to request exact uniform sampling from special well known convex bodies through the following input parameters:
|
n |
The number of points that the function is going to sample. |
A d\times n
matrix that contains, column-wise, the sampled points from the convex polytope P.
R.Y. Rubinstein and B. Melamed, “Modern simulation and modeling” Wiley Series in Probability and Statistics, 1998.
A Smith, Noah and W Tromble, Roy, “Sampling Uniformly from the Unit Simplex,” Center for Language and Speech Processing Johns Hopkins University, 2004.
# 100 uniform points from the 2-d unit ball
points = direct_sampling(n = 100, body = list("type" = "ball", "dimension" = 2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.