Skip to main content

Module simplex

Module simplex 

Source

Enums§

SimplexCoord
Coordinate system for simplex (Aitchison) log/exp maps: centered log-ratio (Clr, d-dim, sum-zero) or additive log-ratio (Alr, (d-1)-dim relative to a reference part).

Functions§

alr
Additive log-ratio coordinates relative to reference: alr(x)_j = ln x_j - ln x_ref for j != ref, yielding (d-1) columns. Requires strictly positive compositions.
closure
clr
Centered log-ratio coordinates: clr(x)_j = ln x_j - mean_k ln x_k after closure. Requires strictly positive compositions.
inverse_alr
Inverse additive log-ratio: map (d-1) ALR coordinates back to the simplex via a numerically stable softmax with the reference logit pinned to zero.
parse_simplex_coord
Parse a simplex coordinate label. "simplex"/"clr" → CLR, "alr" → ALR.
simplex_exp_map
Riemannian exp map from tangent coordinates back to the simplex at base, inverting simplex_log_map for the matching coordinate system.
simplex_frechet_mean
simplex_log_map
Riemannian log map at an intrinsic simplex base point, expressed in the chosen coordinate system: the difference of the values’ and base’s CLR/ALR coordinates.
validate_simplex_array