Laplace function

The Laplace Distribution

The Laplace Distribution

Density, distribution function, quantile function and random generation for the (symmetric) Laplace distribution.

dl(x, mu = 0, sigma = 1, log = FALSE) pl(x, mu = 0, sigma = 1, lower.tail = TRUE, log.p = FALSE) ql(p, mu = 0, sigma = 1, lower.tail = TRUE, log.p = FALSE) rl(n, mu = 0, sigma = 1)

Arguments

  • x: vector of quantiles.
  • p: vector of probabilities.
  • n: number of observations.
  • mu: location parameter.
  • sigma: positive scale parameter.
  • log,log.p: logical; if TRUE, probabilities are log--transformed.
  • lower.tail: logical; if TRUE (default), probabilities are P[Xx]P[X \le x] otherwise, P[X>x]P[X > x]. Similarly for quantiles.

Details

The Laplace distribution has density

f(x)=12σe(2)σxμ f(x) =\frac{1}{\sqrt{2}\sigma}e^{-\frac{\sqrt(2)}{\sigma} |x - \mu|}

where μ\mu is the location parameter and σ\sigma is the scale parameter. Note that based on this parameterization, the distribution has variance σ2\sigma^2.

Returns

dl gives the density and rl generates random deviates.

References

Kotz, S., Kozubowski, T., and Podgorski, K. (2001). The Laplace distribution and generalizations. Boston, MA: Birkhauser.

Author(s)

Marco Geraci

See Also

MultivariateLaplace, GenLaplace

  • Maintainer: Marco Geraci
  • License: GPL (>= 2)
  • Last published: 2023-11-24

Useful links