simplex | R Documentation |
Generation of grid points over the multivariate simplex
simplex(d, n=50, a=0, b=1)
d |
A positive integer indicating the dimension of the simplex. |
n |
A positive integer indicating the number of grid points to be generated on the univariate components of the simplex. |
a,b |
Two numeric values indicating the lower and upper bound of the simplex. By default |
A d-dimensional simplex is defined by
S = { (ω_1, …, ω_d) \in R^d_+: ∑_{i=1}^d ω_i = 1 }.
Here the function defines the simplex as
S = { (ω_1, …, ω_d) \in [a,b]^d: ∑_{i=1}^d ω_i = 1 }.
When d=2
and [a,b]=[0,1], a grid of points of the form { (ω_1, ω_2) \in [0,1]: ω_1 + ω_2 = 1 }.
Returns a matrix with d columns. When d=2
, the number of rows is n.
When d>2
, the number of rows is equal to
∑_{i_{d-1}=0}^{n-1} ∑_{i_{d-2}=0}^{n-i_{d-1}} \cdots ∑_{i_{1}=1}^{n-i_{d-1}-\cdots-i_{2}} i_{1}
Simone Padoan, simone.padoan@unibocconi.it, https://faculty.unibocconi.it/simonepadoan/; Boris Beranger, borisberanger@gmail.com https://www.borisberanger.com;
### 3-dimensional unit simplex W <- simplex(d=3, n=10) plot(W[,-3], pch=16)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.