Accelerating the pace of engineering and science

# logncdf

Lognormal cumulative distribution function

## Syntax

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

## Description

p = logncdf(x,mu,sigma) returns values at x of the lognormal cdf with distribution parameters mu and sigma. mu and sigma are the mean and standard deviation, respectively, of the associated normal distribution. x, mu, and sigma can be vectors, matrices, or multidimensional arrays that all have the same size. A scalar input for x, mu, or sigma is expanded to a constant array with the same dimensions as the other inputs.

[p,plo,pup] = logncdf(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] = logncdf(___,'upper') returns the complement of the lognormal 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.

logncdf 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 lognormal cdf is

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

## Examples

expand all

### Compute the Lognormal Distribution cdf

Compute the cdf of a lognormal distribution with mu = 0 and sigma = 1.

```x = (0:0.2:10);
y = logncdf(x,0,1);
```

Plot the cdf.

```plot(x,y);
grid;
xlabel('x');
ylabel('p');
```