# exppdf

Exponential probability density function

## Syntax

``y = exppdf(x)``
``y = exppdf(x,mu)``

## Description

example

````y = exppdf(x)` returns the probability density function (pdf) of the standard exponential distribution, evaluated at the values in `x`.```

example

````y = exppdf(x,mu)` returns the pdf of the exponential distribution with mean `mu`, evaluated at the values in `x`.```

## Examples

collapse all

Compute the density of the observed value `5` in the standard exponential distribution.

`y1 = exppdf(5) `
```y1 = 0.0067 ```

Compute the density of the observed value `5` in the exponential distributions specified by means `1` through 5.

`y2 = exppdf(5,1:5)`
```y2 = 1×5 0.0067 0.0410 0.0630 0.0716 0.0736 ```

Compute the density of the observed values `1` through `5` in the exponential distributions specified by means `1` through `5`, respectively.

`y3 = exppdf(1:5,1:5)`
```y3 = 1×5 0.3679 0.1839 0.1226 0.0920 0.0736 ```

## Input Arguments

collapse all

Values at which to evaluate the pdf, specified as a nonnegative scalar value or an array of nonnegative scalar values.

• To evaluate the pdf at multiple values, specify `x` using an array.

• To evaluate the pdfs of multiple distributions, specify `mu` using an array.

If either or both of the input arguments `x` and `mu` are arrays, then the array sizes must be the same. In this case, `exppdf` expands each scalar input into a constant array of the same size as the array inputs. Each element in `y` is the pdf value of the distribution specified by the corresponding element in `mu`, evaluated at the corresponding element in `x`.

Example: `[3 4 7 9]`

Data Types: `single` | `double`

Mean of the exponential distribution, specified as a positive scalar value or an array of positive scalar values.

• To evaluate the pdf at multiple values, specify `x` using an array.

• To evaluate the pdfs of multiple distributions, specify `mu` using an array.

If either or both of the input arguments `x` and `mu` are arrays, then the array sizes must be the same. In this case, `exppdf` expands each scalar input into a constant array of the same size as the array inputs. Each element in `y` is the pdf value of the distribution specified by the corresponding element in `mu`, evaluated at the corresponding element in `x`.

Example: `[1 2 3 5]`

Data Types: `single` | `double`

## Output Arguments

collapse all

pdf values evaluated at the values in `x`, returned as a scalar value or an array of scalar values. `y` is the same size as `x` and `mu` after any necessary scalar expansion. Each element in `y` is the pdf value of the distribution specified by the corresponding element in `mu`, evaluated at the corresponding element in `x`.

collapse all

### Exponential pdf

The exponential distribution is a one-parameter family of curves. The parameter μ is the mean.

The pdf of the exponential distribution is

`$y=f\left(x|\mu \right)=\frac{1}{\mu }{e}^{\frac{-x}{\mu }}.$`

A common alternative parameterization of the exponential distribution is to use λ defined as the mean number of events in an interval as opposed to μ, which is the mean wait time for an event to occur. λ and μ are reciprocals.

## Alternative Functionality

• `exppdf` is a function specific to the exponential distribution. Statistics and Machine Learning Toolbox™ also offers the generic function `pdf`, which supports various probability distributions. To use `pdf`, create an `ExponentialDistribution` 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 `exppdf` is faster than the generic function `pdf`.

• 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.

## Version History

Introduced before R2006a