pdfCauchy#

Purpose#

Computes the probability density function for the Cauchy distribution.

Format#

p = pdfCauchy(x, mu, sigma)#
Parameters:
  • x (NxK matrix, Nx1 vector or scalar) – data

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

  • sigma (NxK matrix, Nx1 vector or scalar) – Scale parameter. ExE conformable with x. sigma must be greater than 0.

Returns:

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

Remarks#

The probability density function for the Cauchy distribution is defined as:

\[f(x) = \bigg(\pi \sigma \Big(1+\Big(\frac{x−\mu}{\sigma}\Big)^2\Big)\bigg) ^{−1}\]

Examples#

// Data points
x = { -2, 0, 1, 2 };

// Cauchy PDF with location = 0, scale = 1
p = pdfCauchy(x, 0, 1);
print p;

After the code above, p is equal to:

0.063661977
 0.31830989
 0.15915494
0.063661977

See also

Functions cdfCauchy()