Finding the AGM of two terms is well understood. Since both its Arithmetic and Geometric components can be generalised (identity for a single term, undefined for fewer), can the AGM also be generalised? I would assume yes and further assume identity for a single term undefined for less than one term. I would expect an implementation to use multi term implementation in the first round and the optimised two term variant until it converges (for a given precision).
-
Just to make sure I understand what you are asking, you are wondering if there is a generalization of the AGM for $n$ terms where $n$ can be any integer? – John Martin Apr 13 '16 at 21:09
-
@JohnMartin, Any positive integer, but yes and if the naive implementation would be correct. – hildred Apr 13 '16 at 21:11
-
My first inclination is as follows: say you have $n$ numbers $x_1,\ldots x_n$. Define $a_1 = \frac{1}{n}(x_1+ \ldots + x_n)$ and $b_1 = (x_1\ldots x_n)^{1/n}$. Then define $a_{n+1} = \frac{1}{2}(a_n + g_n)$ and $b_{n+1} = \sqrt{a_ng_n}$. It sounds like this is what you are suggesting... – John Martin Apr 13 '16 at 21:17
-
I can think of some other ways to generalize but I am not sure which is the "right" one. – John Martin Apr 13 '16 at 21:23
-
@JohnMartin, If your Bs were Gs That would be exactly the naive implementation. – hildred Apr 13 '16 at 21:24
-
Oh, hah. Sorry. The $g's$ and $b's$ are supposed to be the same. There are some other ideas that I have but this "naïve" implementation seems pretty reasonable to me. You could check (using SAGE for example if you know it) that these sorts of things do in fact converge... – John Martin Apr 13 '16 at 21:24
-
1Have you seen this? – J. M. ain't a mathematician May 25 '16 at 06:05
4 Answers
I am certainly not versed in that matter, but my intuition tells me this: the geometric mean is the antilogaritm of the arithmetic mean of the logarithms. Similarly, the harmonic mean is the inverse of the arithmetic mean of the inverses. More generally, means can be related to the arithmetic mean by $T^{-1}(\overline{T(x)})$, where $T$ is an invertible scalar transform.
For a particular definition of a mean, the transformation can be discovered from a functional equation involving just two values. And as the means are homogeneous functions, one of the values can be $1$ WLOG.
For the geometric mean, the equation reads
$$T^{-1}\left(\frac{T(1)+T(x)}2\right)=\sqrt x$$ or
$$T(1)+T(x)=2T(\sqrt x).$$
And for the AGM, it would be
$$T(1)+T(x)=2T(AGM(1,x)).$$
Here is a plot of a numerical estimate, with $T(1)=T'(1)=1$ (orange curve, blue is the $AGM$).
I find the "naive implementation" somehow less than satisfying.
The nice thing about the AGM of two terms is that you start with two terms $a_0$ and $g_0$ and calculate $a_{r+1}=f_1(a_r,g_r)$ and $g_{r+1}=f_2(a_r,g_r)$. There is a mapping from two terms to two terms to two terms to ...
The naive implementation suggests a first stage in which there is a mapping from $n$ terms to 2 terms, after which there is a mapping from 2 terms to 2 terms.
It seems to me that what you really want is $n$ different mappings from $n$ terms to $n$ terms.
So start with $x_{1,0}, x_{2,0}, x_{3,0}, ... , x_{n,0}$
Have a set of functions $f_1, f_2, f_3, ... , f_n$ such that $x_{k,r+1}=f_k(x_{1,r}, x_{2,r}, x_{3,r}, ... , x_{n,r})$
For $n=2$ we have $f_1(x_{1,r}, x_{2,r})=\frac {x_{1,r}+ x_{2,r}}2$ and $f_2(x_{1,r}, x_{2,r})=\sqrt{x_{1,r} \times x_{2,r}}$
The problem comes in deciding what the third, fourth, etc functions should be. They could be other kinds of means.
To satisfy the property of convergence, it would be good if the functions had the same "centring" effect that means do; namely that $\min(a, b, c, d, ...) \le f(a,b,c,d,...)\le \max(a,b,c,d,...)$

- 9,594
-
Fascinating, but I am not certain that would be an AGM. If you broke the dependency on number of terms and functions being equal there might be an application for finding all the means of a set (even if the set was smaller than the number of means, but the biases would definitely change. On the other hand if we always assume that that the X mean of a single element of a set is that element where X is any mean formula or algorithm the naive implementation does see a decreasing progression of terms (n where n>=3, 2,1) as the AGM does converge in all cases where the terms are positive. – hildred Apr 13 '16 at 22:19
Consider the function $f(x)=\ln x$ for $x>0.$ We have $f''(x)=-1/x^2.$ Since $f''<0$ the graph of $f$ is concave: That is, take points $p1,...,p_n$ on the graph of $f$, take $(u,v)$ belonging to the convex hull of $\{p_1,...,p_n\}$ (...the smallest convex set $S$ such that $S\supset \{p_1,...,p_n\}$... ). Then $(u,v)$ is "below the graph", that is, $$v\leq\ln u.$$ Now, with $p_j=(x_j,y_j)=(x_j,\ln x_j)$ for $j=1,...,n,$ the convex hull of $\{p_1,...,p_n\}$ is equal to the set of points of the form $$(\;\sum_{j=1}^n w_jx_j,\;\sum_{j=1}^nw_jy_j\;)$$ for non-negative $w_1,...,w_n$ satisfying $\sum_{j=1}^nw_j=1.$ Therefore for some such $w_1,..,w_n$ we have $$\sum_{j=1}^nw_j\ln x_j=\sum_{j=1}^nw_jv_j=v \leq \ln u=\ln (\sum_{j=1}^nw_jx_j).$$ Since $v\leq \ln u\iff e^v\leq u,$ we have therefore$$\prod_{j=1}^n(x_j)^{w_j}\leq\sum_{j=1}^nw_j x_j$$ whenever each $x_j>0$ and each $w_j\geq 0$ and $\sum_{j=1}^nw_j=1.$ In particular when $w_j=1/n$ for each $j,$ we have $$[\;\prod_{j=1}^n( x_j) \;]^{1/n}=\prod_{j=1}^n (x_j)^{1/n}\leq \sum_{j=1}^nx_j/n=\frac {1}{n}\sum_{j=1}^nx_j.$$ Observe that the graph of $f$ is strictly concave: So if $n>1$ and none of the $w_j$ is $0,$ then none of the inequlities are equalities unless $p_1=p_2=...=p_n,$ that is, unless $x_1=x_2=...=x_n.$

- 57,985
As I said in my first attempt at answering, I find the "naive implementation" somehow less than satisfying because there are different stages.
So I thought again about the mean of three numbers. It can be shown that you don't have to add all three values together and divide by three. Instead you can take this approach:
Start with $a_{1,0}=x_1, a_{2,0}=x_2, a_{3,0}=x_3$
Set $a_{1,1}=\frac {a_{1,0}+a_{2,0}}2, a_{2,1}=\frac {a_{2,0}+a_{3,0}}2, a_{3,1}=\frac {a_{3,0}+a_{1,0}}2$
Repeating this gives values that converge to the arithmetic mean.
You can do something simliar with the geometric mean.
So my suggestion for you is this:
Start with $x_1, x_2, x_3, ... , x_n$
Set $a_{1,1}=\frac {x_1+x_2}2, a_{2,1}=\frac {x_2+x_3}2, ... , a_{n-1,1}=\frac {x_{n-1}+x_n}2, a_{n,1}=\frac {x_{n}+x_1}2$
Set $g_{1,1}=\sqrt{a_{1,1} \times a_{2,1}}, g_{1,2}=\sqrt{a_{2,1} \times a_{3,1}}, g_{n-1,1}=\sqrt{a_{n-1,1} \times a_{n,1}},g_{n,1}=\sqrt{a_{n,1} \times a_{1,1}}$
Continue in this manner and I think you have what you wanted.

- 9,594
-
What advantage does defining all elements in a recursive fashion have? how do the a and g sets converge to each other? – hildred Apr 14 '16 at 00:55
-
If you just follow through with the $a$ all three values converge to the arithmetic mean. If you just follow through with the $g$ all three values converge to the geometric mean. Alternating gives you (maybe?) the AGM. – tomi Apr 14 '16 at 07:37
-
You know, the more I think about this, the less I like this approach! It "works" for $n=3$ but fails dismally for $n=2$. – tomi Apr 14 '16 at 07:48
-
And my complaint that there are two kinds of processes in the naive implementation is bogus. I have two processes in my version - the first calculation of the a is from x, but from there on the calculation of a is from g. But in the original, the first stage calculations of a and g are from x, followed by calculating a from the previous a and g. My method does not follow this through. – tomi Apr 14 '16 at 07:52