The mean of points on a unit n-sphere $S^n$ A unit n-sphere is defined as $$\mathcal{S}^n = \{\mathbf{p} \in \mathbb{R}^{n+1}: \|\mathbf{p}\| = 1\}$$
The distance between two points $\mathbf{p}$, $\mathbf{q}$ on $\mathcal{S}^n$ is the great-circle distance:
$$\rho(\mathbf{p},\mathbf{q}) = \arccos(\mathbf{p}^T \mathbf{q})$$
where $\arccos(\cdot): [-1,1] \to [0,\pi]$ is the inverse cosine function.
Given a set of points on $\mathcal{S}^n$, I would like to compute the mean (centroid) of these points. Since the surface of a unit n-sphere is not a Euclidean space, I guess we cannot use arithmetic mean in this case.
Question: how do we compute this mean point $\boldsymbol{\mu} \in \mathcal{S}^n$, taking into account the spherical geometry?
 A: There cannot be a meaningful definition of a unique centroid for all sets of points on $S^n\subset\mathbb R^{n+1}$ that is invariant under isometries. To see this, consider the corners $p_0, \dots, p_{n+1}\in S^n$ of a regular $(n+2)$-simplex. There are isometries of $S^n$ that permute the corners in any possible way, and these form a representation of the symmetric group $\Sigma_{n+2}$. If $p\in S^n$ was the centroid and $\gamma\in\Sigma_{n+2}$ one of the isometries that fix $\{p_0,\dots,p_{n+1}\}$ as a set, then $\gamma(p)$ would also be a legitimate centroid. But the action of $S_{n+2}$ has no common fixpoint.
A: I think what you're looking for is the field of statistics known as directional statistics. Even for the circle $S^1$ it's not obvious how things should be defined, but it is possible, depending on context.
A: The mean on a Riemannian manfold is called Karcher-mean (or Frechet mean on metric spaces). It minimizes the sum of the squares of geodesic distances to the data. 
It is no longer unique, nor does it depend continuously on the data: it may jump. But if the data points are near to each other, then it is unique. There is also the notion of a sticky mean which stays constant under each small deformation of the data (but not on the sphere).


*

*H. Karcher, Riemannian center of mass and mollifier smoothing, Communications on Pure and Applied Mathematics, vol xxx (1977), 509-541

*Means in complete manifolds: uniqueness and approximation. Marc Arnaudon, Laurent Miclo. arXiv

*Medians and means in Riemannian geometry: existence, uniqueness and computation.
Marc Arnaudon, Frédéric Barbaresco, Le Yang. arXiv
