Documentation

# expinv

Exponential inverse cumulative distribution function

## Syntax

```X = expinv(P,mu) [X,XLO,XUP] = expinv(P,mu,pcov,alpha) ```

## Description

`X = expinv(P,mu)` computes the inverse of the exponential `cdf` with parameters specified by mean parameter `mu` for the corresponding probabilities in `P`. `P` and `mu` 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 input. The parameters in `mu` must be positive and the values in `P` must lie on the interval [0 1].

`[X,XLO,XUP] = expinv(P,mu,pcov,alpha)` produces confidence bounds for `X` when the input mean parameter `mu` is an estimate. `pcov` is the variance of the estimated `mu`. `alpha` specifies 100(1 - `alpha`)% confidence bounds. The default value of `alpha` is 0.05. `XLO` and `XUP` are arrays of the same size as `X` containing the lower and upper confidence bounds. The bounds are based on a normal approximation for the distribution of the log of the estimate of `mu`. If you estimate `mu` from a set of data, you can get a more accurate set of bounds by applying `expfit` to the data to get a confidence interval for `mu`, and then evaluating `expinv` at the lower and upper end points of that interval.

The inverse of the exponential cdf is

`$x={F}^{-1}\left(p|\mu \right)=-\mu \mathrm{ln}\left(1-p\right)$`

The result, x, is the value such that an observation from an exponential distribution with parameter µ will fall in the range [0 x] with probability p.

## Examples

Let the lifetime of light bulbs be exponentially distributed with µ = 700 hours. What is the median lifetime of a bulb?

```expinv(0.50,700) ans = 485.2030 ```

Suppose you buy a box of “700 hour” light bulbs. If 700 hours is the mean life of the bulbs, half of them will burn out in less than 500 hours.