Stratified matrix sampling

版本 1.0.0 (1.8 KB) 作者: Jan Motl
Random matrix sampling, which is stratified by rows and columns
67.0 次下载
更新时间 2019/7/9

查看许可证

We can easily sample a matrix with rand() function. However, this sampling is sometimes too random - we may end up with rows or columns without any sample and "screw" the downstream code. The canonical solution to this problem is to use stratified sampling. This function implements stratification by both, rows and columns, for a rectangular matrix.

The sampling is without replacement (each field in the matrix can be selected at most once). And we have to provide the count of samples that we want to select.

The function does not use rejection sampling and is reasonably fast (~twice as slow as rand()).

引用格式

Jan Motl (2024). Stratified matrix sampling (https://www.mathworks.com/matlabcentral/fileexchange/72097-stratified-matrix-sampling), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2018a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Propagation and Channel Models 的更多信息
标签 添加标签

Community Treasure Hunt

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

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