pdfexp#

Purpose#

Computes the probability density function for the exponential distribution.

Format#

p = pdfexp(x, a, b)#
Parameters:
  • x (NxK matrix, Nx1 vector or scalar) – x must be greater than a.

  • a (NxK matrix, Nx1 vector or scalar) – Location parameter. ExE conformable with x.

  • b (scalar) – the scale parameter. sometimes called beta. b must be greater than 0.

Returns:

p (NxK matrix, Nx1 vector or scalar) – the probability density function for the exponential distribution for the elements in x.

Remarks#

pdfExp() calculates the probability density function for the two-parameter exponential distribution, which is defined as

\[f(x) = \frac{1}{b} exp \big( − \frac{x−a}{b} \big)\]

Examples#

// Data points
x = { 0.5, 1, 2, 5 };

// Exponential PDF with location = 0, scale = 1
p = pdfexp(x, 0, 1);
print p;

After the code above, p is equal to:

  0.60653066
  0.36787944
  0.13533528
0.0067379470

See also

Functions cdfexp()