RE: [HACKERS] Standard Deviation function. - Mailing list pgsql-hackers

From Stupor Genius
Subject RE: [HACKERS] Standard Deviation function.
Date
Msg-id 000001bd9031$1fe5e800$d39daccf@darren
Whole thread Raw
In response to Re: [HACKERS] Standard Deviation function.  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] Standard Deviation function.
Re: [HACKERS] Standard Deviation function.
List pgsql-hackers
> > > I really need a Standard Deviation aggregate function...
> >
> > I thought about this a long time ago and had an idea but never
> > got around to trying to implement it.  I was going to have some
> > functions that worked on a structure of two doubles to track
> > the sum and square instead of using only one simple type.
>
> I remember talking about this to someone, and the problem is that you
> needed the average WHILE scanning through the table, which required two
> passes, which the aggregate system is not designed to do.  I may be
> wrong on this, though.

I had asked you how to calculate this and the variance early last
year.  One (I think the variance) was two-pass because of the need
for the average, but I thought the StdDev would work with the struct.

Been a while and I still haven't configured #(*&^ FreeBSD ppp yet.

darrenk

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Standard Deviation function.
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Standard Deviation function.