normcdf

From DavinciWiki
Jump to: navigation, search

Description

Cumulative distribution function for normal distribution

Arguments and Return Values

Arguments: Two numeric arrays of any format for the lower and upper limits, and two optional scalar (1x1x1) values specifying the mean and standard deviation of the distribution

Return Value: An array with the same organization as the input limits containing the expected proportion of samples between the lower and upper limits. The output format is double if the input is double, float otherwise.

This function is defined as normcdf(z) = integral from negative infinity to z of normpdf(t) with respect to t = erf(z/√2)/2, where z = (x-μ)/σ

This function returns the expected proportion of samples (in a normal distribution) between the input numbers of standard deviations from the mean. For example, if you want to find the expected proportion of samples between -1 and 1 standard deviations of the mean, use normcdf(-1, 1).

This function does computations with the error function (erf), which is accurate within the input precision.

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

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

Usage

Syntax: normcdf(a, b, mean=μ, stdv=σ)

'a' - A numeric array of any format, specifying the lower limit

'b' - A numeric array of any format, specifying the upper limit

'mean' - A scalar value specifying the mean of the distribution

'stdv' - A scalar value specifying the standard deviation of the distribution; must be positive

a and b are passed by value, but mean and stdv should be passed by reference, e.g. normcdf(90, 110, mean=100, stdv=10)

If mean and/or stdv are omitted, the function will use the standard values of μ = 0 and σ = 1

Examples

dv> normcdf()

Cumulative distribution function for normal distribution
Does computations with the error function (erf)
normcdf(a, b, mean=mu, stdv=sigma) = (erf(z(b)) - erf(z(a)))/2
If mean and/or stdv are omitted, defaults to standard values of mu=0 and stdv=1
z = (x - mu)/(sigma*sqrt(2))
Returns cumulative probability between a and b in the normal distribution
normcdf(b, mean=mu, stdv=sigma) returns probability between -Inf and b
Equivalent to integrating normpdf(z) from z(a) to z(b)
Matches input precision
Works for arrays
S.Marshall 02-22-2008

0
dv> normcdf(0//-1//-2//-3,0//1//2//3)
4x1x1 array of float, bsq format [16 bytes]
0.00000 0.682689        0.954500        0.997300
dv> normcdf(90, 110, mean=100, stdv=10)
0.682689

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