Geometric average: how to compute it: best approach ?
- From: pamela fluente <pamelafluente@xxxxxxxxx>
- Date: Tue, 17 Jul 2007 02:48:19 -0700
I want to write a very little computer program in which computes the
geometric mean of a large amount n of numbers Xi read from some data
source.Say for istance n = 1,000,000,000,000 numbers.
GM = (X1 * X2 * ... * Xn ) ^ 1/n
GM has the dimension of any of the Xi.
I cannot do all the multiplications first, because the computer will
not hold the result.
Also I guess I cannot apply the exponent to each single Xi before
multiplication because of the large n,
with consequent imprecision and extreme slowness...
How can proceed, say in an incremental way, to compute GM. What is the
best approach.?
Can anyone propose some pseudocode?
-P
.
- Follow-Ups:
- Re: Geometric average: how to compute it: best approach ?
- From: hagman
- Re: Geometric average: how to compute it: best approach ?
- From: Raymond Manzoni
- Re: Geometric average: how to compute it: best approach ?
- From: Peter Webb
- Re: Geometric average: how to compute it: best approach ?
- From: Raymond Manzoni
- Re: Geometric average: how to compute it: best approach ?
- Prev by Date: Re: cross product differential
- Next by Date: Re: computing (3 + 4*i)^n
- Previous by thread: x^3-A*y^3=1 (Pell's equation)
- Next by thread: Re: Geometric average: how to compute it: best approach ?
- Index(es):
Loading