cdfLaplace

Purpose

Computes the cumulative distribution function for the Laplace distribution.

Format

p = cdfLaplace(x, loc, scale)
Parameters:
  • x (NxK matrix, Nx1 vector or scalar.) – Values at which to evaluate the cumulative distribution function for the Laplace distribution.

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

  • scale (NxK matrix, Nx1 vector or scalar) – Scale parameter; ExE conformable with x. \(0 < scale\).

Returns:

p (NxK matrix, Nx1 vector or scalar) – Each element in p is the cumulative distribution function for the Laplace distribution evaluated at the corresponding element in x.

Examples

// Values of interest
x = 2;

// Location parameter
loc = 0;

// Scale parameter
scale = 3;

p = cdfLaplace(x, loc, scale);

After the above code, P will equal:

0.7433

Remarks

The cumulative distribution function for the Laplace distribution is defined as

\[\begin{split}f(x, \mu, b) = \begin{cases} \frac{1}{2} exp(\frac{(x-\mu)}{b}), & x \lt \mu\\ 1 - \frac{1}{2} exp(-\frac{(x - \mu)}{b}), & x \ge \mu \end{cases}\end{split}\]

See also

cdfLaplaceInv()