Skip to content

INV_NORM

Return an inverse normal distribution x-value, given a known probability (or percentile) and optional mean and standard deviation values. This function uses the Beasley-Springer-Moro approximation; the return value is not an exact value.

The INV_NORM syntax is as follows:

INV_NORM(percentage, [ mean, stddev ] )
percentage
Any numeric value from >0 to <1. If only the first argument is specified, mean = 0 and stddev = 1. In other words: inv_norm(p) = inv_norm(p, 0, 1).
mean
Any numeric value. If you specify mean, you must also specify stddev.
stddev
Any numeric value >0. When the mean and stddev arguments are specified, the output of the function is scaled, using the specified mean and stddev values.

When invalid values are supplied, the function returns NULL. However, when NaN is specified for any argument, the function returns NaN.

Examples

For example:

yellowbrick=# select inv_norm(0.90) from sys.const;
    inv_norm     
------------------
 1.28155156327703
(1 row)

yellowbrick=# select inv_norm(0.90,70,4.5) from sys.const;
    inv_norm     
------------------
 75.7669820347467
(1 row)
yellowbrick=# create table doubles(c1 float8, c2 float4, c3 real);
CREATE TABLE
yellowbrick=# insert into doubles values(1.1234,2.1234,3.1234);
INSERT 0 1
yellowbrick=# insert into doubles values(0.1234,1.1234,2.1234);
INSERT 0 1
yellowbrick=# select inv_norm(c1,c2,c3) from doubles;
    inv_norm      
-------------------
           [NULL]
 -1.33583043079482
(2 rows)