Thread: aggregate function stddev

aggregate function stddev

From
Kemin Zhou
Date:
Implementers:

Just noticed that the postgres stddev is the stddev_sample formula.  
There are two different ways to calculate this value.
Their difference is very small with large samle size.  It would be nice 
to distinguish the two different versions. 

I also noticed that oracle has stddev_sample and stddev_population. 
This is just a wish list. 

Kemin



**********************************************************************
Proprietary or confidential information belonging to Ferring Holding SA or to one of its affiliated companies may be
containedin the message. If you are not the addressee indicated in this message (or responsible for the delivery of the
messageto such person), please do not copy or deliver this message to anyone. In such case, please destroy this message
andnotify the sender by reply e-mail. Please advise the sender immediately if you or your employer do not consent to
e-mailfor messages of this kind. Opinions, conclusions and other information in this message represent the opinion of
thesender and do not necessarily represent or reflect the views and opinions of Ferring.
 
**********************************************************************



Re: aggregate function stddev

From
Josh Berkus
Date:
Kemin,

> Just noticed that the postgres stddev is the stddev_sample formula.
> There are two different ways to calculate this value.
> Their difference is very small with large samle size.  It would be nice
> to distinguish the two different versions.

Note sent to PGSQL-DOCS.

> I also noticed that oracle has stddev_sample and stddev_population.
> This is just a wish list.

Were you aware that in PostgreSQL you can write your own aggregates?   It's 
relatively easy to do.

-- 
Josh Berkus
Aglio Database Solutions
San Francisco


Re: aggregate function stddev

From
Bruce Momjian
Date:
Is this a TODO?

---------------------------------------------------------------------------

Josh Berkus wrote:
> Kemin,
> 
> > Just noticed that the postgres stddev is the stddev_sample formula.
> > There are two different ways to calculate this value.
> > Their difference is very small with large samle size.  It would be nice
> > to distinguish the two different versions.
> 
> Note sent to PGSQL-DOCS.
> 
> > I also noticed that oracle has stddev_sample and stddev_population.
> > This is just a wish list.
> 
> Were you aware that in PostgreSQL you can write your own aggregates?   It's 
> relatively easy to do.
> 
> -- 
> Josh Berkus
> Aglio Database Solutions
> San Francisco
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
>       joining column's datatypes do not match
> 

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073