| random_init_simplex | R Documentation |
Generates a random point in the (p-1)-simplex.
random_init_simplex(p, rdist = stats::rnorm, tol = 1e-10, maxtimes = 100)
p |
An integer, the dimension. |
rdist |
A function that generates a random number when called using |
tol |
A small positive number. Samples are regenerated until each of the |
maxtimes |
An integer, maximum number of attempts. |
p numbers are generated from rdist and their absolute values are normalized to sum to 1. This will be repeated up to maxtimes times until all p components are larger than or equal to tol.
A random point (p-vector) in the (p-1)-simplex, i.e. sum(x) == 1 && x > 0.
random_init_simplex(100, stats::rnorm, 1e-10, 100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.