
# The Riemannian center of mass

The Riemannian center of mass can be computed for a matrix of m x n points, which computed n means simultaneously of m points each. The mean of one such set $x_1,...,x_n\in\M$ is defined as a (not necessarily unique) minimizer of

For this implementation one can further compute a weighted mean, by introducing the summands $w_id_{\M}^2(x_i,x)$. The stopping criterion is a functional based on the currend iterate, the last iterate and the number of iterations, where usually a maximum iterations number and a minimial change (of $\varepsilon>0$) is used (see stopCritMaxIterEpsilonCreator).

The algorithm follows [1].

### Matlab Documentation

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
% mean(x) calculates the m means of the input data x [.,m,n]
% with gradient descent algorithm. The implementation follows
%
% B. Afsari, Riemannian Lp center of mass: Existence,
%    uniqueness, and convexity,
%    Proc. AMS 139(2), pp.655-673, 2011.
%
% INPUT
%    x :  m x n Data points ([this.Itemsize,m,n]) to compute
%         m means of n points each, pp.
% OUTPUT
%    y :  m data points of the means calculated
%
% OPTIONAL
% 'Weights' : (1/n*ones([m,n]) 1xn or mxn weights for the mean
%            the first case uses the same weights for all means
% 'InitVal' : m Initial Data points for the gradient descent
% 'MaxIterations': maximal number of iterations
% 'Epsilon'      : change of bewteen to iterates to stop
%
% ---
% Manifold-valued Image Restoration Toolbox 1.0,
% J. Persch 2015-07-24 | R. Bergmann 2018-02-16


1. Afsari, B (2011). Riemannian $L^p$center of mass: Existence, uniqueness, and convexity. Proceedings of the American Mathematical Society. 139 655–73