Standard Deviation, Variance, and Quantile Functions
Hi all, I'm trying to run a simple standard deviation function on a column using MonetDB -- select stdev( columnname ) from tablename -- is this possible with the current release? The only posts I can find about stdev() or variance() are quite old, such as a 2008 post requesting medians (which has been implemented) and quantiles (which I cannot find?) http://osdir.com/ml/db.monetdb.bugs/2008-06/msg00206.html a 2010 post offering to add these functions to the main release code. http://mail.monetdb.org/pipermail/users-list/2010-January/003836.html What would be the easiest way to get MonetDB to produce standard deviations, variances, and quantiles (let's say the 25th percentile)?
From the discussion list, it looks like people have succeeded in doing it, but they're probably much more advanced users than I am. ;)
Thanks!!! _______________________________________________ users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list
On 04-11-2012 08:10:51 -0500, Anthony Damico wrote:
a 2010 post offering to add these functions to the main release code.
[2]http://mail.monetdb.org/pipermail/users-list/2010-January/003836.html
What would be the easiest way to get MonetDB to produce standard deviations, variances, and quantiles (let's say the 25th percentile)?
From the discussion list, it looks like people have succeeded in doing it, but they're probably much more advanced users than I am. ;)
http://bugs.monetdb.org/show_bug.cgi?id=2454#c18 suggests stddev and median have been added (niels), so if they aren't there, file a new bug, or reopen the old one. Fabian _______________________________________________ users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list
It appears that the problem is in sql/scripts/39_analytics.sql. It's
missing bindings for stdev and stdevp.
For stdev, at least, it seems that one can mimic median with something like
the following:
create aggregate stdev(val TINYINT) returns TINYINT
external name "aggr"."stddev";
create aggregate stdev(val SMALLINT) returns SMALLINT
external name "aggr"."stddev";
create aggregate stdev(val INTEGER) returns INTEGER
external name "aggr"."stddev";
create aggregate stdev(val BIGINT) returns BIGINT
external name "aggr"."stddev";
create aggregate stdev(val REAL) returns REAL
external name "aggr"."stddev";
create aggregate stdev(val DOUBLE) returns DOUBLE
external name "aggr"."stddev";
create aggregate stdev(val DATE) returns DATE
external name "aggr"."stddev";
create aggregate stdev(val TIME) returns TIME
external name "aggr"."stddev";
create aggregate stdev(val TIMESTAMP) returns TIMESTAMP
external name "aggr"."stddev";
This can of course be run through the mclient, so anyone needing to patch
their environment prior to this bug being fixed might be able to just run
these manually.
I've included this info in the bug.
Cheers,
Percy
On Mon, Nov 5, 2012 at 1:42 AM, Fabian Groffen
On 04-11-2012 08:10:51 -0500, Anthony Damico wrote:
a 2010 post offering to add these functions to the main release code.
[2]http://mail.monetdb.org/pipermail/users-list/2010-January/003836.html
What would be the easiest way to get MonetDB to produce standard deviations, variances, and quantiles (let's say the 25th percentile)?
From the discussion list, it looks like people have succeeded in doing it, but they're probably much more advanced users than I am. ;)
http://bugs.monetdb.org/show_bug.cgi?id=2454#c18 suggests stddev and median have been added (niels), so if they aren't there, file a new bug, or reopen the old one.
Fabian
_______________________________________________ users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list
-- Percy Wegmann +1 512 637 8500 ext 148 _______________________________________________ users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list
participants (3)
-
Anthony Damico
-
Fabian Groffen
-
Percy Wegmann