Re: standard normal cumulative distribution function

From: SunWuKung <Balazs(dot)Klein(at)axelero(dot)hu>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: standard normal cumulative distribution function
Date: 2006-01-21 00:01:28
Message-ID: MPG.1e3b9846df12eb6998968b@news.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

This is exactly what I was looking for, could you post that please.
thx
B.

> On Sat, Jan 21, 2006 at 12:00:49AM +0100, SunWuKung wrote:
> > Does somebody have/know of a function for pg returning the standard
> > normal cumulative distribution for a Z score?
>
> Are you looking for something like this?
>
> test=> SELECT z, cdf_ugaussian_p(z) FROM generate_series(-3, 3) AS g(z);
> z | cdf_ugaussian_p
> ----+---------------------
> -3 | 0.00134989803163009
> -2 | 0.0227501319481792
> -1 | 0.158655253931457
> 0 | 0.5
> 1 | 0.841344746068543
> 2 | 0.977249868051821
> 3 | 0.99865010196837
> (7 rows)
>
> cdf_ugaussian_p() is just a little wrapper I put around the GNU
> Scientific Library's gsl_cdf_ugaussian_P() function. I can post
> an example of how to do that if it's what you're looking for.
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steinar H. Gunderson 2006-01-21 00:05:19 Re: [GENERAL] Creation of tsearch2 index is very slow
Previous Message Michael Fuhr 2006-01-20 23:54:00 Re: standard normal cumulative distribution function