InflGame.domains.rd.#

InflGame.domains.rd.dirichlet_distribution(bin_points, alphas)#

Compute a Dirichlet distribution for resources on the probability simplex.

Uses the Dirichlet probability density function to model resource distribution on a simplex. The Dirichlet distribution is a multivariate generalization of the beta distribution and is particularly useful for modeling resources in simplex domains.

The distribution is defined as:

\[R(\mathbf{b}) = \frac{1}{B(\boldsymbol{\alpha})} \prod_{i=1}^{k} b_i^{\alpha_i-1}\]

where \(B(\boldsymbol{\alpha})\) is the multivariate beta function:

\[B(\boldsymbol{\alpha}) = \frac{\prod_{i=1}^{k} \Gamma(\alpha_i)}{\Gamma(\sum_{i=1}^{k} \alpha_i)}\]

and \(\mathbf{b} = (b_1, b_2, \ldots, b_k)\) with \(\sum_{i=1}^{k} b_i = 1\) and \(b_i \geq 0\).

Parameters:
bin_pointsnp.ndarray | torch.Tensor

Points on the simplex where the distribution is evaluated, shape \((N, k)\) where \(k\) is the dimension of the simplex. Each point must satisfy simplex constraints.

alphaslist | np.ndarray

Concentration parameters \(\boldsymbol{\alpha} = (\alpha_1, \alpha_2, \ldots, \alpha_k)\) of the Dirichlet distribution. All values must be positive.

Returns:
np.ndarray

Computed resource distribution values (probability density) at the specified bin_points.

Notes

This function handles edge cases where bin_points fall outside or on the boundary of the simplex by applying small corrections to ensure valid simplex coordinates before evaluation.

  • Points with any coordinate \(\leq 0\) are projected onto the simplex

  • Points with coordinates exactly 0 or 1 are adjusted by small epsilon values to avoid numerical issues with the Dirichlet PDF

Examples

>>> # 3D simplex points (must sum to 1)
>>> bin_points = np.array([[0.33, 0.33, 0.34], [0.1, 0.2, 0.7]])
>>> resources = dirichlet_distribution(bin_points, alphas=[2, 2, 2])