stats/
geo_mean.pro
topgeo_mean
result = geo_mean(in [, DOUBLE=DOUBLE])
compute the geometric mean of an array
this is only valid if all values are positive (geometric mean)
plays with mean and log to make sure you are not multiplying huge numbers together
Return value
the geometric mean
Parameters
- in in required
array to compute geometric mean of
Keywords
- DOUBLE in optional
do the calulation in double precision
Examples
b=[1,2,3,4,5,6]
print, geo_mean(b, /double)
2.9937952
print, geo_mean(b)
2.99380
Author information
- History:
Tue Jan 22 14:18:13 2008, Brian Larsen changed to use message, added zero warning, and should handle NaN now Wed Dec 21 18:37:41 2005, Brian Larsen written and tested
Statistics
| Lines: | 19 |
| McCabe complexity: |
File attributes
| Modifcation date: | Mon Sep 22 12:39:32 2008 |
| Lines: | 75 |
![[attach.png]](../idldoc-resources/attach.png)