RE: geometric mean aggregate function

2002-05-13 Thread Andrew Gould
Thank you to each of you who responded with help. Unfortunately, while testing a Python script, I found the drawback to the geometric mean calculation: If your sample size is in the hundreds of thousands, it's easy to hit the hardware (processor) limitation on the number size while multiplying t

RE: geometric mean aggregate function

2002-05-11 Thread Gordon
This is probably not the most elegent solution, but here is something that works in 3 SQL statements using user variables. mysql> select @gmean := 1, @ct := count(*) from g_mean; mysql> select @gmean := @gmean * test_val from g_mean; mysql> select power(@gmean, (1/@ct)) as Geo_Mean; See details

RE: geometric mean aggregate function

2002-05-11 Thread Matthew Walker
Interesting idea, Andrew. I don't know how to do what you're asking for, but I'd be interested to see it added too. I'd never heard of geometric means, but I can already think of several areas where they might be useful. Thanks for sharing the information on how they're calculated! Matthew Walker