Skip to contents

Sample n times from the unit simplex in d dimensions

Usage

sample_unit_simplexn(d, n)

Arguments

d

the dimension

n

the number of samples to take uniformly in the d space

Value

The grid over Theta, the parameter space. To be converted to a matrix with d columns and nsamp rows

Examples

matrix(sample_unit_simplexn(3, 10), ncol = 3, byrow = TRUE)
#>              [,1]       [,2]       [,3]
#>  [1,] 0.718495130 0.19342793 0.08807694
#>  [2,] 0.545058828 0.05200676 0.40293441
#>  [3,] 0.670106158 0.11986601 0.21002783
#>  [4,] 0.022625113 0.20701737 0.77035752
#>  [5,] 0.272771111 0.57843816 0.14879073
#>  [6,] 0.155351288 0.64789074 0.19675797
#>  [7,] 0.200405368 0.10644329 0.69315134
#>  [8,] 0.383119368 0.15271837 0.46416226
#>  [9,] 0.098178410 0.75343204 0.14838955
#> [10,] 0.003964658 0.03780315 0.95823219