From: | Andrew Gould <andrewgould(at)yahoo(dot)com> |
---|---|
To: | Postgres Mailing List <pgsql-general(at)postgresql(dot)org> |
Subject: | requesting features in PostgreSQL |
Date: | 2002-04-26 12:54:30 |
Message-ID: | 20020426125430.62788.qmail@web13408.mail.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
I would like to request a new aggregate function for
PostgreSQL.
I need an aggregate function that calculates geometric
mean, and can be used in SQL statements the same as
any other aggregate function such as count(), sum()
and avg(). Rather than have a custom function, I'd
like to see it added as a standard PostgreSQL feature.
Is there a specific PostgreSQL developer that I should
contact? Or is an open request on this list
sufficient for consideration?
The geometric mean function, I'll call it gmean(), is
similar to avg(), except that instead of adding the
individual values, you would multiply them; and
instead of dividing the sum by the sample size, you
would raise the resulting product by a power of (1 /
sample size).
Therefore, the gmean() of the values 1, 2, 3 and 9
would equal:
= (1 * 2 * 3 * 9) ^ (1 / 4)
= 54 ^ 0.25
= 2.710806 # rounded to 6 decimal places
This function differs from arithmetic mean (average)
in that it lessens the affect of outliers without
discounting them altogether.
Thanks,
Andrew Gould
__________________________________________________
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/
From | Date | Subject | |
---|---|---|---|
Next Message | postgres | 2002-04-26 13:36:56 | intel vs amd benchmark for pg server |
Previous Message | webmaster | 2002-04-26 12:50:53 | delete column |