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

Description Usage Arguments Value References Examples

View source: R/RcppExports.R

Description

The d-dimensional unit simplex is the set of points \vec{x}\in \R^d, s.t.: ∑_i x_i≤q 1, x_i≥q 0. The d-dimensional canonical simplex is the set of points \vec{x}\in \R^d, s.t.: ∑_i x_i = 1, x_i≥q 0.

Usage

1

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

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

volesti documentation built on July 14, 2021, 5:11 p.m.