invnorm

From DavinciWiki
Jump to: navigation, search

Description

Inverse cumulative probability function for normal distribution

Arguments and Return Values

Arguments: One numeric array, with all elements between 0 and 1 (exclusive)

Return Value: An array with the same organization as the input containing the value of the inverse normal function evaluated at the each element of the input. The output format is double if the input is double, float otherwise.

The inverse normal function is defined such that invnorm(y) = z iff y = normcdf(-Inf, z) = normcdf(z).

This function returns the z-value such that the cumulative probability in a normal distribution between negative infinity and z standard deviations from the mean equals the input. For example, if you want to find the number of standard deviations between in which lie the middle 20% of a sample (in a normal distribution), take invnorm(0.4) for the lower boundary and invnorm(0.6) for the upper boundary.

This function uses a numerical approximation from Peter J. Acklam, which has a relative error of less than 1.2e-9 (in double precision).

Return format is double if input is double; float otherwise.

If no arguments are input, invnorm() prints its description, as shown below.

Usage

Syntax: invnorm(y)

'y' - A numeric array of any format

Examples

dv> invnorm()

Inverse cumulative probability function for normal distribution
z = invnorm(y) iff y = normcdf(z)
Input must be y such that 0 < y < 1
Algorithm from http://home.online.no/~pjacklam/notes/invnorm/
Relative errors (in double precision) are less than 1.2e-9
Matches input format
Works for arrays
S.Marshall 02-22-2008

0
dv> invnorm(0.4//0.6)
2x1x1 array of float, bsq format [8 bytes]
-0.253347       0.253347
dv> normcdf(-0.253347, 0.253347)
0.200000
dv> normcdf(-1)
0.158655
dv> invnorm(0.158655)
-1.00000

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left

Major Sub-Functions

Related Functions

Recent Library Changes

Created On: 02-25-2008
Modified On: 02-25-2008

Personal tools