Re: Covariance Function in Postgresql??

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: Covariance Function in Postgresql??
Дата
Msg-id 3E9353C5.2050404@joeconway.com
обсуждение исходный текст
Ответ на Covariance Function in Postgresql??  (jonathan.nichols@sbcglobal.net (Jonathan Nichols))
Список pgsql-general
Jonathan Nichols wrote:
>     I'm looking to take the covariance of two columns in a postgresql
> table.  I know there are sum, average, variance and standard deviation
> functions.  Is there a covariance function hiding somewhere?

There is no built in aggregate for covariance. In fact, there is no
notion of an aggregate that works across two columns (at least that I'm
aware of). But you could use PL/R to create a function that executes a
sql statement and calculates covariance. For more on PL/R, see:
http://www.joeconway.com/

HTH,

Joe


В списке pgsql-general по дате отправления:

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: Arrays ... need clarification....
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: extracting time from a timestamp with time zone field