Continuous sampling: linear, random, from simplex

版本 1.5.0.0 (2.1 KB) 作者: Simone
Linearly and randomly sampling points in simplex.
211.0 次下载
更新时间 2019/5/13

查看许可证

Samples continuous points in an interval. It allows for both linear and
uniform random sampling. It is also possible to draw points only in the
simplex of the interval.
Inputs:
- lo : lower bound (column of length D)
- hi : upper bound (column of length D)
- N : number of points to sample
- useSimplex : put 1 if you want to sample from the simplex of the bound, 0 otherwise
- linearly : put 1 if you want the points to be linearly spaced, 0 otherwise
Outputs:
- points : D-by-NN matrix with random points, where NN >= N

More information about sampling from the simplex:
http://math.stackexchange.com/questions/502583/uniform-sampling-of-points-on-a-simplex

引用格式

Simone (2024). Continuous sampling: linear, random, from simplex (https://www.mathworks.com/matlabcentral/fileexchange/50480-continuous-sampling-linear-random-from-simplex), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2012b
兼容任何版本
平台兼容性
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.5.0.0

fix case with simplex = 1 and dim = 1

1.4.0.0

Fixed a small error that occurred when sampling linearly in 1D.
Changed title.

1.3.0.0

Tags fixed.

1.2.0.0

Added the possibility to do linear sampling also in the simplex.

1.1.0.0

Changed title.

1.0.0.0