Accelerating the pace of engineering and science

# normcdf

Normal cumulative distribution function

## Syntax

p = normcdf(x)
p = normcdf(x,mu,sigma)
[p,plo,pup] = normcdf(x,mu,sigma,pcov,alpha)
[p,plo,pup] = normcdf(___,'upper')

## Description

p = normcdf(x) returns the standard normal cdf at each value in x. The standard normal distribution has parameters mu = 0 and sigma = 1. x can be a vector, matrix, or multidimensional array.

p = normcdf(x,mu,sigma) returns the normal cdf at each value in x using the specified values for the mean mu and standard deviation sigma. x, mu, and sigma can be vectors, matrices, or multidimensional arrays that all have the same size. A scalar input is expanded to a constant array with the same dimensions as the other inputs. The parameters in sigma must be positive.

[p,plo,pup] = normcdf(x,mu,sigma,pcov,alpha) returns confidence bounds for p when the input parameters mu and sigma are estimates. pcov is the covariance matrix of the estimated parameters. alpha specifies 100(1 - alpha)% confidence bounds. The default value of alpha is 0.05. plo and pup are arrays of the same size as p containing the lower and upper confidence bounds.

[p,plo,pup] = normcdf(___,'upper') returns the complement of the normal cdf at each value in x, using an algorithm that more accurately computes the extreme upper tail probabilities. You can use 'upper' with any of the previous syntaxes.

The function normcdf computes confidence bounds for p using a normal approximation to the distribution of the estimate

$\frac{X-\stackrel{^}{\mu }}{\stackrel{^}{\sigma }}$

and then transforming those bounds to the scale of the output p. The computed bounds give approximately the desired confidence level when you estimate mu, sigma, and pcov from large samples, but in smaller samples other methods of computing the confidence bounds might be more accurate.

The normal cdf is

$p=F\left(x|\mu ,\sigma \right)=\frac{1}{\sigma \sqrt{2\pi }}{\int }_{-\infty }^{x}{e}^{\frac{-{\left(t-\mu \right)}^{2}}{2{\sigma }^{2}}}dt$

The result, p, is the probability that a single observation from a normal distribution with parameters µ and σ will fall in the interval (-∞ x].

The standard normal distribution has µ = 0 and σ = 1.

## Examples

expand all

### Compute Normal Distribution cdf

What is the probability that an observation from a standard normal distribution will fall on the interval [-1 1]?

```p = normcdf([-1 1]);
p(2)-p(1)```
```ans =
0.6827```

More generally, about 68% of the observations from a normal distribution fall within one standard deviation, σ, of the mean, µ.