direct_sampling: Sample perfect uniformly distributed points from well known...

View source: R/RcppExports.R

direct_samplingR Documentation

Sample perfect uniformly distributed points from well known convex bodies: (a) the unit simplex, (b) the canonical simplex, (c) the boundary of a hypersphere or (d) the interior of a hypersphere.

Description

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.

Usage

direct_sampling(body, n)

Arguments

body

A list to request exact uniform sampling from special well known convex bodies through the following input parameters:

  • type A string that declares the type of the body for the exact sampling: a) 'unit_simplex' for the unit simplex, b) 'canonical_simplex' for the canonical simplex, c) 'hypersphere' for the boundary of a hypersphere centered at the origin, d) 'ball' for the interior of a hypersphere centered at the origin.

  • dimension An integer that declares the dimension when exact sampling is enabled for a simplex or a hypersphere.

  • radius The radius of the d-dimensional hypersphere. The default value is 1.

  • seed A fixed seed for the number generator.

n

The number of points that the function is going to sample.

Value

A d\times n matrix that contains, column-wise, the sampled points from the convex polytope P.

References

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.

Examples

# 100 uniform points from the 2-d unit ball
points = direct_sampling(n = 100, body = list("type" = "ball", "dimension" = 2))

volesti documentation built on Sept. 19, 2023, 5:08 p.m.