---
title: Barycentric Coding Model Overview
url: https://www.emergentmind.com/topics/barycentric-coding-model
type: topic
---

# Barycentric Coding Model Overview

Barycentric Coding Model denotes a family of representations in which an observation is encoded by barycentric weights on a simplex or probability simplex. In the literature represented here, the expression is used in three technically distinct settings: an explicit feature map obtained from nested simplicial partitions for large-scale classification; a Wasserstein-2 model in which an unknown measure is represented by its barycentric coordinates relative to known reference measures; and a correspondence-analysis-compatible recoding of continuous variables for hierarchical clustering of mixed-type data [2002.01999][2201.12195][2201.13280]. The common structural constraint is a coordinate vector $\lambda$ with $\lambda_i\ge 0$ and $\sum_i \lambda_i = 1$, often with strong sparsity, while broader work on barycentric algebra places such constructions within a general theory of convex-combination operations [2308.11634].

## 1. Geometric and algebraic basis

In a non-degenerate simplex $S\subset\mathbb{R}^d$ of dimension $D$, with vertices $v_0,\dots,v_D$, every point $x\in S$ has a unique representation
$$
x=\sum_{i=0}^D \lambda_i v_i,\qquad \lambda_i\ge 0,\qquad \sum_{i=0}^D \lambda_i=1.
$$
The coefficients $\lambda=(\lambda_0,\dots,\lambda_D)$ are the barycentric coordinates of $x$ relative to that simplex. In the broader algebraic formalism, a barycentric algebra is a set $A$ equipped with operations $(x,y)\mapsto x\,y\,\underline p$ for $p\in(0,1)$ satisfying idempotence, skew-commutativity, and skew-associativity; ordinary convex subsets of real vector spaces instantiate this abstraction via $x\,y\,\underline p=(1-p)x+py$ [2002.01999][2308.11634].

The same geometric idea supports several coordinate systems. For convex polytopes, Gibbs coordinates choose the entropy-maximizing convex decomposition; Wachspress coordinates are rational functions; chordal coordinates on a polygon use barycentric coordinates in a single triangle of a triangulation and therefore have exactly three nonzero weights; cartographic coordinates average chordal systems over the dihedral symmetry group [2308.11634]. On any simplex and on any semisimplex, all three systems coincide. This provides the canonical baseline against which the distinct BCM variants are best understood.

| Usage in the literature | Object being coded | Defining mechanism |
|---|---|---|
| Explicit feature-map BCM | $x\in\mathbb{R}^d$ | Nested simplicial partition and local barycentric coordinates |
| Wasserstein BCM | $\mu_0\in\mathcal{P}_{2,\mathrm{ac}}(\mathbb{R}^d)$ | Barycentric coordinates of a Wasserstein-2 barycenter of known measures |
| Mixed-data barycentric coding | Continuous sample values $x_i$ | Reversible ordinal transform followed by recursive barycentric fuzzy coding |

A recurrent misconception is to treat BCM as a single standardized algorithm. The literature instead uses the term for a class of models whose common feature is simplex-constrained coordinate coding, but whose ambient spaces, objectives, and statistical roles differ substantially.

## 2. Nested simplicial BCM as an explicit feature map

The construction in "Nested Barycentric Coordinate System as an Explicit Feature Map" begins with one large root simplex covering the data domain, for example a regular unit simplex of side length $1$. At each stage $t=1,\dots,q$, every current simplex is split into $(d+1)$ smaller simplices by inserting its own barycenter. If a simplex has vertices $(v_{i_0},\dots,v_{i_d})$, the added point is
$$
c=\frac{v_{i_0}+\cdots+v_{i_d}}{d+1},
$$
and the parent simplex is subdivided into $d+1$ children, each missing one original vertex and including $c$. For any point $x$, the embedding first identifies the unique chain of nested simplices $S^0\supset S^1\supset\cdots\supset S^q$ containing $x$; at each level $t$, $x$ lies in exactly one of the $d+1$ sub-simplices of $S^{t-1}$. Across levels, Lemma 2 gives a simple linear relation between barycentric coordinates at levels $t$ and $t+1$, so $\lambda_{i,t+1}(x)$ can be updated from $\lambda_{i,t}(x)$ [2002.01999].

After $q$ splits, the construction has introduced $T=(d+1)^q$ new points, indexed as $v_0,\dots,v_T$. The feature map $\Phi_q(x)\in\mathbb{R}^{T+1}$ is defined componentwise by
$$
[\Phi_q(x)]_i=
\begin{cases}
\lambda_i(x), & \text{if } v_i \text{ is one of the } (d+1) \text{ vertices of the level-}q \text{ simplex containing } x,\\
0, & \text{otherwise.}
\end{cases}
$$
Equivalently, $\Phi_q(x)$ has exactly $d+1$ nonzeros equal to the local barycentric coordinates and satisfies $\|\Phi_q(x)\|_1=1$. As $q$ grows, the partition refines and the embedding becomes higher-dimensional but remains sparse.

A linear separator is then learned in the embedded space,
$$
f(x)=w\cdot \Phi_q(x)+b,
$$
via any off-the-shelf linear SVM. Within each small simplex $S$, $\Phi_q(x)$ is an affine map of the original $x$, because it selects the barycentric coordinates of $x$ in $S$. Accordingly, $f(x)$ restricted to that simplex is a linear function of $x$. Globally, the decision function is piecewise-linear, with pieces aligned to the simplicial partition. The decision boundary may therefore be highly non-linear, though linear within each simplex, and the method can approximate any convex body.

## 3. Statistical guarantees, complexity, and empirical behavior of the explicit-map model

Two theorems bound the true error $R$ in terms of the empirical low-margin rate $\hat R$ and the sample size $n$. For uniform subdivision with data-independent splits stopping at level $q$, Theorem 3 states that with probability at least $1-\delta$,
$$
R \le \hat R + O\!\bigl(1/(\gamma\sqrt{n})+\sqrt{(\ln(q/\delta))/n}\bigr),
$$
where $\gamma$ is the margin parameter. For adaptive splitting, if only $k$ split points are used adaptively, Theorem 4 gives with probability at least $1-\delta$
$$
R \le \hat R + O\!\bigl(1/(\gamma\sqrt{n-k})+\sqrt{(\ln(q/\delta))/(n-k)}\bigr).
$$
The first bound follows from the classic SVM margin bound plus stratification over $q$; the second uses a hybrid sample-compression argument [2002.01999].

The computational profile is favorable when $q$ is fixed as a constant. Building the embedding is $O(d^2 n)$, training a sparse linear SVM on $(d+1)$-sparse vectors is $O(dn)$, and classification of a new point is $O(q\,d^2)$. The principal memory limitation is that the feature dimension grows as $(d+1)^q$, even though the feature vectors remain extremely sparse. In practice the construction restricts $q$ to at most $5$. Section 3.4 introduces data-dependent splitting heuristics intended to reduce the number of empty simplices, focus refinement on regions of misclassification, and improve the accuracy-versus-dimension trade-off.

The empirical evaluation covers large UCI/LibSVM datasets—letter, Skin-nonSkin, cod-rna, shuttle, and covtype—with $n$ up to $581\,k$ and $d$ up to $54$. The comparison includes 2nd/3rd-degree explicit polynomial SVMs implemented in LibSVM, RBF kernel SVM in CoreSVM, uniform NBCS, and adaptive NBCS. For $q\in\{2,\dots,5\}$, adaptive NBCS and uniform NBCS achieved comparable or better accuracy than polynomial and RBF SVM, often at lower wall-clock cost. On covtype $(581\,k\times 54)$, 3rd-degree SVM took $\sim 8\,k\,s$, whereas adaptive NBCS took $\sim 2.1\,k\,s$ with higher accuracy. On medium-sized vision datasets, compared to Random Kitchen Sinks, Nyström, adaptive $\chi^2$, and related baselines, adaptive NBCS consistently led or matched the best accuracy.

## 4. Wasserstein-2 BCM and inverse barycenter estimation

Werenski et al. formulate BCM in $\mathcal{W}_2$ as a model for measure estimation. Let $\mathcal{P}_{2,\mathrm{ac}}(\mathbb{R}^d)$ denote the Borel probability measures on $\mathbb{R}^d$ with finite second moment and absolute continuity. For known reference measures $\{\nu_i\}_{i=1}^k\subset \mathcal{P}_{2,\mathrm{ac}}$, and any weight vector $\lambda=(\lambda_1,\dots,\lambda_k)\in\Delta^{k-1}$, the Wasserstein-2 barycenter is
$$
\nu_\lambda=\arg\min_{\mu\in\mathcal{P}_{2,\mathrm{ac}}}\sum_{i=1}^k \lambda_i W_2^2(\mu,\nu_i).
$$
The synthesis problem computes $\nu_\lambda$ given $\lambda$ and the $\nu_i$. The analysis problem inverts this: given an unknown measure $\mu_0\in\mathcal{P}_{2,\mathrm{ac}}$ that is a barycenter of $\{\nu_i\}$, recover its barycentric coordinate $\lambda$ by solving
$$
\lambda^*=\arg\min_{\lambda\in\Delta^{k-1}} W_2^2(\mu_0,\nu_\lambda).
$$
In this BCM, an unknown measure is modeled by its coordinate $\lambda$ in the probability simplex [2201.12195].

The geometric reduction uses the Riemannian structure of $\mathcal{W}_2$. For any $\mu\in\mathcal{P}_{2,\mathrm{ac}}$, the tangent space $T_\mu\mathcal{P}_2$ is identified with gradients of convex functions, with inner product
$$
\langle u,v\rangle_{L^2(\mu)}=\int \langle u(x),v(x)\rangle\,d\mu(x).
$$
By Brenier's theorem, the unique optimal transport map from $\mu$ to $\nu_i$ is $T_i=\nabla\phi_i$, and the Fréchet gradient of
$$
G_\lambda(\mu)=\frac12\sum_{i=1}^k \lambda_i W_2^2(\mu,\nu_i)
$$
is
$$
\nabla G_\lambda(\mu)=-\sum_{i=1}^k \lambda_i (T_i-Id)\in T_\mu\mathcal{P}_2.
$$
A Karcher mean is any $\mu$ satisfying $\|\nabla G_\lambda(\mu)\|_{L^2(\mu)}=0$, and under assumptions A1–A3 any Karcher mean is the unique barycenter $\nu_\lambda$.

At the true $\mu_0$, let $T_i$ be the optimal maps from $\mu_0$ to $\nu_i$, define
$$
A_{ij}=\langle T_i-Id,T_j-Id\rangle_{L^2(\mu_0)},
$$
and
$$
b_i=\langle T_i-Id,Id\rangle_{L^2(\mu_0)}=\int \langle T_i(x)-x,x\rangle\,d\mu_0(x).
$$
Then
$$
W_2^2(\mu_0,\nu_\lambda)=\lambda^\top A\lambda-2b^\top \lambda+\int \|x\|^2\,d\mu_0,
$$
while the gradient-norm surrogate is
$$
\|\nabla G_\lambda(\mu_0)\|^2=\lambda^\top A\lambda.
$$
Because $A$ is positive semidefinite, recovering $\lambda$ becomes a convex quadratic program on the simplex,
$$
\min_{\lambda\in\Delta} \lambda^\top A\lambda-2b^\top \lambda.
$$
Under compatibility of the family $\{\nu_i\}$, the minimizers of the true projection and the quadratic program coincide.

## 5. Sample-based estimation, convergence, and applications in the Wasserstein model

When $\mu_0$ and the $\nu_i$ are observed only through i.i.d. samples, the estimation procedure splits the sample from $\mu_0$ in half, uses one half to estimate the transport maps, and uses the other half to compute empirical inner products. For each reference measure, it solves the entropic OT dual with regularization $\epsilon$ and forms the entropic map estimate
$$
\hat T_i(x)=
\frac{
\sum_{j=1}^n Y^{(i)}_j \exp[(g_i(Y^{(i)}_j)-\tfrac12\|x-Y^{(i)}_j\|^2)/\epsilon]
}{
\sum_{j=1}^n \exp[(\cdots)/\epsilon]
},
$$
which converges in $L^2(\mu_0)$ to the true $T_i$ with rate $O(n^{-(\alpha+1)/(2(d'+\alpha+1))}\sqrt{\log n})$. The empirical Gram matrix and linear term are then
$$
\hat A_{ij}=\frac1n\sum_{\ell=n+1}^{2n}\langle \hat T_i(X_\ell)-X_\ell,\hat T_j(X_\ell)-X_\ell\rangle,
$$
and
$$
\hat b_i=\frac1n\sum \langle \hat T_i(X_\ell)-X_\ell,X_\ell\rangle,
$$
after which one solves
$$
\hat\lambda=\arg\min_{\lambda\in\Delta}\lambda^\top \hat A\lambda-2\hat b^\top\lambda.
$$
The point-cloud version is given as Algorithm Estimate-$\lambda$-PC [2201.12195].

Under assumptions A4–A6, with $\epsilon\asymp n^{-1/(d'+\alpha+1)}$, the entropic map estimate satisfies
$$
E[\|\hat T_i-T_i\|_{L^2(\mu_0)}^2]\lesssim n^{-(\alpha+1)/(2(d'+\alpha+1))}\log n,
$$
where $d'=2\lceil d/2\rceil$. If $A$ has a single zero eigenvalue and $\mu_0$ is exactly a barycenter so that $\lambda^{*\top}A\lambda^*=0$, then
$$
E[\|\hat\lambda-\lambda^*\|_2^2]\lesssim n^{-1/2}+n^{-(\alpha+1)/(4(d'+\alpha+1))}\sqrt{\log n}.
$$
Thus $\hat\lambda\to\lambda^*$ in mean square at a rate determined by smoothness $\alpha$ and dimension $d$. The computational complexity is dominated by the entropic OT stage: each of the $p$ entropic solves on an $n\times n$ cost takes $O(n^2\log n/\epsilon^2)$ via Sinkhorn; Gram-matrix evaluation costs $O(p^2nd)$; the simplex QP can be solved in $O(p^3)$ or faster using conditional-gradient methods; the overall cost is $\sim O(p\cdot n^2\log n/\epsilon^2)$ plus lower-order terms.

The applications in the paper illustrate the model's scope. For Gaussian covariance estimation, with $\nu_i=\mathcal{N}(0,S_i)$ and $\mu_0=\mathcal{N}(0,S_0)$, the optimal maps are linear, $T_i(x)=C_i x$, and the resulting QP reconstructs $S_{\hat\lambda}$ as the barycenter of the $\{S_i\}$. The method empirically outperforms naive MLE on small samples and is orders-of-magnitude faster than autograd-based MLE. For image inpainting and denoising, each $28\times 28$ gray-scale image is treated as a probability histogram on the grid, and the recovered $\hat\lambda$ is used to reconstruct the image as a barycenter of reference images; the procedure competes with state-of-the-art histogram regression methods of Bonneel et al. at $\gtrsim 10\times$ speed-up. For natural language processing, documents are represented as empirical measures on word2vec embeddings, and on BBCSport and 20News the BCM-based classifiers outperform 1-NN and average-distance baselines in small-sample regimes.

## 6. Barycentric coding for mixed-type hierarchical clustering

Moschidis, Markos and Chadjipadelis use barycentric coding to recode continuous variables before agglomerative hierarchical clustering of mixed-type data. For a continuous variable $X=(x_1,\dots,x_N)$ with minimum $u=\min_i x_i$ and maximum $M=\max_i x_i$, they first define
$$
d_0=\min_{i\neq j}|x_i-x_j|,
$$
choose the unique integer $m$ satisfying
$$
m-1<\frac{M-u}{d_0}\le m,
$$
partition $[u,M]$ into $m$ half-open bins of width $d_0$, and set
$$
T(x)=\left\lfloor\frac{x-u}{d_0}\right\rfloor+1.
$$
By construction, no bin contains more than one observed value, so $T$ is one-to-one on the observed sample. Step 1 therefore replaces the continuous variable by an $m$-level ordinal variable $X_i^{\mathrm{ord}}=T(x_i)\in\{1,\dots,m\}$ [2201.13280].

Step 2 fuzzy-codes this ordinal variable into an $n$-tuple in $\mathbb{R}^n$ by a recursive barycentric split of unit mass. Let the interval $(B_0,B_n)=(1-\tfrac12,m+\tfrac12)$ be divided into $n$ equal subintervals with knots
$$
B_i=i\frac{m}{n}+\left(1-\tfrac12\right),\qquad i=0,1,\dots,n,
$$
and midpoints
$$
A_i=\frac{B_{i-1}+B_i}{2},\qquad i=1,\dots,n.
$$
If the ordinal level $\ell$ lies in $(B_j,B_{j+1}]$, the unit mass at $\ell$ is first split between the bounding knots,
$$
m_j=\frac{B_{j+1}-\ell}{B_{j+1}-B_j},\qquad m_{j+1}=1-m_j,
$$
and then recursively redistributed upstream and downstream so that a vector $y_\ell=(y_{\ell,1},\dots,y_{\ell,n})\in\mathbb{R}^n$ is obtained with $y_{\ell,i}\ge 0$ and $\sum_i y_{\ell,i}=1$. The map $x\mapsto y$ is reversible on the sample because Step 1 is one-to-one and Step 2 is deterministic. This is the basis for the paper's claim that barycentric coding minimizes information loss relative to ordinary equal-width or quantile binning.

Once every continuous variable has been barycentrically coded into $n$ fuzzy columns and every categorical variable into the usual $0/1$ dummy columns, the data matrix $Z$ is an $N\times J$ nonnegative array whose row sums equal the number of original variables. After normalization to the correspondence matrix $P=Z/n_{\mathrm{tot}}$, with row masses $r_i$, column masses $c_j$, and row profiles $a_i$, the $\chi^2$ distance between observations is
$$
d^2_{\chi^2}(i,i')=\sum_{j=1}^J \frac{1}{c_j}(a_{ij}-a_{i'j})^2
=(a_i-a_{i'})^\top D_{1/c}(a_i-a_{i'}).
$$
Ward's minimum-variance agglomeration is then carried out in the $\chi^2$ metric. For clusters $g$ and $h$, with masses $r_g,r_h$ and profiles $\bar a_g,\bar a_h$, the merge criterion is
$$
\Delta(g,h)=\frac{r_g r_h}{r_g+r_h}\,d_{\chi^2}^2(\bar a_g,\bar a_h).
$$
The algorithm starts from $N$ singleton clusters, repeatedly merges the pair with minimal $\Delta(g,h)$, and yields a dendrogram whose fusion heights are the successive values of $\Delta$.

The empirical results include both real and simulated data. On the diamond pricing example $(N=308,\ K=3)$, barycentric Ward-$\chi^2$ yields three clusters interpreted as small diamonds with IGI certificate and low price, large diamonds with HRD certificate and high price, and medium diamonds with HRD certificate and medium price. On Cleveland Heart Disease $(N=297,\ K=2)$, the method finds two clusters with ARI $\approx 0.39$ against the true disease/no-disease partition, on par with the best competing method and superior to fuzzy-triangular coding. On Credit Approval $(N=653,\ K=2)$, it yields two groups with $91\%$ of observations in one large cluster and $9\%$ in the other, but the true accept/reject split is not fully recovered, with ARI $<0.40$; Gower/PAM and K-prototypes are slightly better at ARI $\approx 0.38$. In a large-scale simulation of $2\,430$ synthetic datasets, mean ARI is reported as approximately $0.579$ for barycentric hierarchical, $0.518$ for K-prototypes, $0.517$ for fuzzy-triangular, $0.484$ for Gower/PAM, and $0.453$ for mixed K-means. Cluster overlap has by far the largest negative effect on all methods; barycentric hierarchical remains the most robust even at $2\%$ overlap.

A second misconception about BCM therefore concerns discretization: in this clustering setting, barycentric coding is not ordinary binning. The construction is designed so that no two observed values share a bin in the first step, neighboring values are not forced into sharply distinct $0/1$ categories in the second, and the resulting code integrates directly with correspondence analysis and Ward-$\chi^2$ clustering.

Source: https://www.emergentmind.com/topics/barycentric-coding-model