Re: stddev returns 0 when there is one row

From: nolan(at)celery(dot)tssi(dot)com
To: pgsql-general(at)postgresql(dot)org (pgsql general list)
Subject: Re: stddev returns 0 when there is one row
Date: 2003-04-21 17:41:34
Message-ID: 20030421174134.7748.qmail@celery.tssi.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> I'm not volunteering, no. (For starters, I think you'd need to upgrade
> the aggregate code to allow multiple-input aggregates. Which is worth
> doing, but I do not expect to have time to think about such things for
> 7.4.)

Having multiple-input aggregates opens up possibilites for a large number
of multivariate statistical measures, either built in or as user-defined
functions. (He says as he works on formatting output from an Oracle DBMS
for time-series analysis via SPSS or SAS.)

I guess I don't understand the point of the count(*) parameter, but
wouldn't the easiest way to offer both sample and population formulas for
variance and standard deviation be to just add two new functions,
varp and stddevp, most of the code for which already exists?

That way they remain single-input aggregates.

(A perfectionist would also include vars and stddevs as equivalents to
the existing var and stddev functions.)
--
Mike Nolan

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2003-04-21 18:01:51 Re: Documentation
Previous Message Oliver Elphick 2003-04-21 17:17:11 Re: Documentation