Documentation

expcdf

Exponential cumulative distribution function

Syntax

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

Description

p = expcdf(x,mu)computes the exponential cdf at each of the values inxusing the corresponding mean parametermu.xandmucan 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 input. The parameters inmumust be positive.

[p,plo,pup] = expcdf(x,mu,pcov,alpha)produces confidence bounds forPpwhen the input mean parametermuis an estimate.pcovis the variance of the estimatedmu.alphaspecifies 100(1 -alpha)% confidence bounds. The default value ofalphais 0.05.ploandpupare arrays of the same size aspcontaining the lower and upper confidence bounds. The bounds are based on a normal approximation for the distribution of the log of the estimate ofmu. If you estimatemufrom a set of data, you can get a more accurate set of bounds by applyingexpfitto the data to get a confidence interval formu, and then evaluatingexpinvat the lower and upper endpoints of that interval.

[p,plo,pup] = expcdf(___,'upper')returns the complement of the exponential cdf at each value inx, using an algorithm that more accurately computes the extreme upper tail probabilities. You can use the'upper'argument with any of the prior syntaxes.

The exponential cdf is

p = F ( x | u ) = 0 x 1 μ e t μ d t = 1 e x μ

The result,p, is the probability that a single observation from an exponential distribution will fall in the interval [0x].

Examples

collapse all

The following code shows that the median of the exponential distribution isµ*log(2).

mu = 10:10:60; p = expcdf(log(2)*mu,mu)
p = 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000

What is the probability that an exponential random variable is less than or equal to the mean, µ?

mu = 1:6; x = mu; p = expcdf(x,mu)
p = 0.6321 0.6321 0.6321 0.6321 0.6321 0.6321

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Introduced before R2006a

Was this topic helpful?