The Matrix Means Toolbox
by Dario Bini and Bruno Iannazzo

The Matrix Mean Toolbox is a toolbox for Octave and Matlab to compute matrix means.

Download the version 2.3 of the toolbox as a zip archive or as a tar gzipped archive (deflating the archive will create a directory with files inside)

The Matrix Means Toolbox includes the following files:

alm.m - Computes the Ando-Li-Mathias mean of k matrices [1]
cheap.m - Computes the cheap mean of k matrices [3]
dist.m - Computes the Riemannian and Euclidean distance between A and B
explog.m - Computes the explog mean of k matrices [2]
karcher.m - Computes the Karcher mean of k matrices using a Richardson-like iteration [4]
mean2.m - Computes the geometric mean of two matrices with three algorithms [6]
nbmp.m - Computes the Nakamura/Bini-Meini-Poloni mean of k matrices [5,7]
random.m - Generates k random positive definite matrices
sharp.m - Computes $A\#_t B$


[1] T. Ando, C.-K. Li and R. Mathias, Geometric means, Linear Algebra Appl., 385-1 (2004) pp. 305-334.
[2] V. Arsigny, P. Fillard, X. Pennec and N. Ayache, Geometric means in a novel vector space structure on symmetric positive-definite matrices, SIAM J. Matrix Anal. Appl., 29-1 (2006/07), pp. 328-347.
[3] D. A. Bini and B. Iannazzo, A note on computing matrix geometric means, Advances Comp. Math., 35-2/4 (2010), pp. 175-192.
[4] D. A. Bini and B. Iannazzo, Computing the Karcher mean of symmetric positive definite matrices, to appear in Linear Algebra Appl., 2012.
[5] D. A. Bini, B. Meini and F. Poloni, An effective matrix geometric mean satisfying the Ando-Li-Mathias properties, Math. Comp., 79 (2010), pp. 437-452.
[6] B. Iannazzo, The geometric mean of two matrices from a computational viewpoint, arXiv preprint arXiv:1201.0101, 2011.
[7] K. Nakamura, Geometric Means of Positive Operators, Kyungpook Math. J. 49 (2009), 167-181

mmtoolbox 2.3 - July 14, 2014 - Fixed a bug in the stepsize computation in karcher.m, updated the file dist.m (thanks to J. Todd).

mmtoolbox 2.2 - Febraury 13, 2014 - Fixed a bug, removed unused files, fixed indent, optimized the Richardson iteration.

mmtoolbox 2.1 - February 11, 2014 - removed unused cycle and duplicated Cholesky factorization in mean2.m. In karcher.m changed log1 with log1p.

mmtoolbox 2.0 - January 10, 2014 - rewritten all files again with major adjustments. Included full Matlab and cell-array support. Removed gradient.m and rich.m for the Karcher mean; now there is the file karcher.m which computes the Karcher mean using the Richardson iteration, starting from the arithmetic mean and with the exponential at the end. Changed geomean.m to mean2.m. Many bugs have been removed.

mmtoolbox 1.1b2 - November 26, 2011 - Some minor adjustments to the formatting of the files.

mmtoolbox 1.1b1 - August, 19, 2011 - rewritten all files from scratch with a uniform style, help in line, and more; changed the square root computation to the Cholesky factor whenever possible; changed the name of the file manton.m to gradient.m; changed the name of the file bmp.m to nbmp.m, as soon as the reference [8] was individuated; fixed a bug in dist.m.

mmtoolbox 1.0 - July 11, 2010 - first release