Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Normal cumulative distribution function

`p = normcdf(x)`

`p = normcdf(x,mu)`

`p = normcdf(x,mu,sigma)`

`[p,pLo,pUp] = normcdf(x,mu,sigma,pCov)`

`[p,pLo,pUp] = normcdf(x,mu,sigma,pCov,alpha)`

`___ = normcdf(___,'upper')`

The

`normcdf`

function uses the inverse complementary error function`erfc`

. The relationship between`normcdf`

and`erfc`

is$$\text{normcdf}(x)=\frac{1}{2}\text{erfc}\left(-\frac{x}{\sqrt{2}}\right).$$

The complementary error function

`erfc(x)`

is defined as$$\text{erfc}(x)=1-\text{erf}(x)=\frac{2}{\sqrt{\pi}}{\displaystyle {\int}_{x}^{\infty}{e}^{-{t}^{2}}dt}.$$

The

`normcdf`

function computes confidence bounds for`p`

by using the delta method.`normcdf(x,mu,sigma)`

is equivalent to`normcdf((x–mu)/sigma,0,1)`

. Therefore, the`normcdf`

function estimates the variance of`(x–mu)/sigma`

using the covariance matrix of`mu`

and`sigma`

by the delta method, and finds the confidence bounds of`(x–mu)/sigma`

using the estimates of this variance. Then, the function transforms the bounds to the scale of`p`

. The computed bounds give approximately the desired confidence level when you estimate`mu`

,`sigma`

, and`pCov`

from large samples.

`normcdf`

is a function specific to normal distribution. Statistics and Machine Learning Toolbox™ also offers the generic function`cdf`

, which supports various probability distributions. To use`cdf`

, create a`NormalDistribution`

probability distribution object and pass the object as an input argument or specify the probability distribution name and its parameters. Note that the distribution-specific function`normcdf`

is faster than the generic function`cdf`

.Use the

**Probability Distribution Function**app to create an interactive plot of the cumulative distribution function (cdf) or probability density function (pdf) for a probability distribution.

[1] Abramowitz, M., and I. A. Stegun. *Handbook of Mathematical
Functions*. New York: Dover, 1964.

[2] Evans, M., N. Hastings, and B. Peacock. *Statistical
Distributions*. 2nd ed., Hoboken, NJ: John Wiley & Sons, Inc., 1993.