Continuous distribution · also called double exponential
Laplace distribution
An exponential decay on both sides of a peak at : sharper at the centre and heavier in the tails than a normal. Least absolute deviations regression is maximum likelihood under Laplace errors, a Laplace prior on weights gives the lasso, and the Laplace mechanism adds this noise to make a statistic differentially private.
Laplace probability calculator
P(X ≤ 0) = 0.5
At the parameters set by the sliders. The shaded region on the plot is the probability; the dots on the CDF mark F at its ends.
CDF
mean 0 · variance 2 · sd 1.414 · mode 0 · entropy 1.693 nats
Formulas
| Parameters |
|
|---|---|
| Support | |
| CDF | |
| Mean | |
| Variance | |
| Mode | |
| MGF | |
| Entropy |
Worked example
A count query has sensitivity 1 and is released with privacy budget by adding Laplace noise with . How often is the released count off by more than 5?
and , about one release in twelve. answer checked by code
How it relates to others
- Transformation← Exponential: The difference of two independent Exponential() variables is Laplace(). checked by code
- Transformation→ Exponential: If is Laplace(), is Exponential(). checked by code
All the relationships, as a diagram →
In Python
from scipy import stats
import numpy as np
X = stats.laplace(loc=0, scale=1)
X.pdf(0.5) # f(0.5) = 0.3033
X.cdf(0.5) # P(X ≤ 0.5) = 0.6967
X.mean(), X.var() # 0, 2
X.ppf(0.95) # 95th percentile
X.rvs(size=10, random_state=0)
rng = np.random.default_rng(0)
rng.laplace(loc=0, scale=1, size=10)Choosing between this and its neighbours? Which distribution for extremes and heavy tails? · Which distribution for measurements and errors?