[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: geometric mean?



Andrew wrote:
> 
> I have no response so I assume the answer is to
> roll your own.
> 
> I did:
> 
>  FUNCTION GEOMEAN, arr
>      RETURN, EXP(TOTAL(ALOG(arr))/N_ELEMENTS(arr))
>  END
> 
> - Andrew
> 
> Sent via Deja.com http://www.deja.com/
> Before you buy.

Hi Andrew,

   I couldn't find such a routine either so I decided to hack it
together using the algorithm you suggest but including some error
cehcking and more caution with range limits or negative values. You
can find geomean.pro on my web pages: 
http://www.mpimet.mpg.de/~schultz.martin/idl/html/libmartin_schultz.html

Cheers,
Martin


-- 
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
[[ Dr. Martin Schultz   Max-Planck-Institut fuer Meteorologie    [[
[[                      Bundesstr. 55, 20146 Hamburg             [[
[[                      phone: +49 40 41173-308                  [[
[[                      fax:   +49 40 41173-298                  [[
[[ martin.schultz@dkrz.de                                        [[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[