simplex: Definition of a multivariate simplex

View source: R/beed.R

simplexR Documentation

Definition of a multivariate simplex

Description

Generation of grid points over the multivariate simplex

Usage

simplex(d, n = 50, a = 0, b = 1)

Arguments

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 bounds of the simplex. By default a = 0 and b = 1, indicating the unit-simplex.

Details

A d-dimensional simplex is defined by

S = \{ (\omega_1, \ldots, \omega_d) \in \mathbb{R}^d_+ : \sum_{i=1}^d \omega_i = 1 \}.

Here the function defines the simplex as

S = \{ (\omega_1, \ldots, \omega_d) \in [a,b]^d : \sum_{i=1}^d \omega_i = 1 \}.

When d = 2 and [a,b] = [0,1], a grid of points of the form \{ (\omega_1, \omega_2) \in [0,1] : \omega_1 + \omega_2 = 1 \} is generated.

Value

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

\sum_{i_{d-1}=0}^{n-1} \sum_{i_{d-2}=0}^{n-i_{d-1}} \cdots \sum_{i_1=1}^{n-i_{d-1}-\cdots-i_2} i_1.

Author(s)

Simone Padoan, simone.padoan@unibocconi.it, https://faculty.unibocconi.it/simonepadoan/; Boris Beranger, borisberanger@gmail.com, https://www.borisberanger.com;

Examples

### 3-dimensional unit simplex
W <- simplex(d = 3, n = 10)
plot(W[,-3], pch = 16)

ExtremalDep documentation built on Aug. 21, 2025, 5:57 p.m.