TL;DR
The Laplace distribution is a symmetric bell curve with a sharp peak at its centre and tails that fall off more slowly than a Gaussian's. It is two mirror-image exponential tails glued back to back at the centre, one on each side. Its scale says how far typical values sit from the centre, and its centre is also its median.
Builds on: Probability Density Function, Exponential Distribution, Exponential Function · Leads to: Differential Privacy, Lasso Regression
Where it's used
Privacy-preserving statistics. A statistics office wants to publish how many people live in a district without revealing whether any one person is in it. It adds random noise drawn from a Laplace distribution to the true count. The noise is scaled to how much one person can change the count, so the published number is useful but no single record is easy to detect. This is the differential privacy Laplace mechanism.
Sparse regression. A model with hundreds of possible predictors needs to keep only a few. Putting a penalty on the absolute size of the coefficients is equivalent to giving each coefficient a Laplace prior in a Bayesian view. The penalty pushes many coefficients to exactly zero, which is why the lasso selects features.
Modelling errors with occasional large jumps. Daily changes in some prices or sensor readings are mostly small, with a few large moves. A Laplace model fits this better than a Gaussian, because it puts more probability on large values for the same typical size. The fitted scale then tells you the typical size of a move.
How it works
Build the distribution from two pieces you already know: a fair coin and an exponential wait with mean 1.
-
Flip a fair coin. If it lands heads, the sign is ; if tails, . Check: each sign has chance .
-
Draw an exponential wait with rate 1, so its mean is 1. Check: short waits are common and long ones rare, as in the Exponential Distribution.
-
Multiply: . Check: the result is positive exactly when the coin said heads.
-
Trace two runs. Heads with gives . Tails with gives . Each run gives one number, and the sign is as likely to be positive as negative.
-
Look at the shape. A value and its mirror have the same chance, so the distribution is symmetric about 0. For the only way to get near is heads and a wait near , so the density there is half the exponential density, . Check: the density at 0 is , the largest value.
-
Write the whole curve in one formula. The density is , where is the absolute value of . Check: the two halves, one for positive and one for negative , each contribute area , so the total area is 1.
Now add the two parameters. A centre shifts the curve, and a scale stretches it. Doubling makes the peak half as high and the curve twice as wide, while keeping the area at 1.
The figure compares the Laplace curve with a Gaussian with the same centre. The Laplace peak is sharper, and its tails are heavier.
- Laplace, b = 1
- Gaussian, sigma = 1
The math
A random variable is Laplace with centre and scale , written , if its density is
Here is the Exponential Function, and is the distance from to the centre.
Step 1 in symbols: a sign and a wait
Let be or with probability each, and let be an exponential wait with mean , independent of . Then is Laplace. The construction is the one in the walkthrough, rescaled and shifted.
Step 2 in symbols: the density
For , the event happens only through and . The chance is times the exponential density at , which is the formula with . The case is the mirror image.
Check that the area is 1. The integral of over the line is twice the integral over :
Step 3 in symbols: the tails
The chance that lies more than from the centre is
Each side contributes , so the two sides together give . Compare this with the Gaussian, whose tail falls off like up to constants. The exponential tail is much heavier for large , which is why the Laplace puts more mass on large values than a Gaussian with the same typical size.
Step 4 in symbols: mean, median and spread
The centre is the mean and the median, both equal to , by symmetry.
The mean absolute deviation from the centre is . The variance is , using that an exponential wait with mean has second moment . So the standard deviation is , a little more than the mean absolute deviation .
Step 5 in symbols: estimating the parameters
Given data , the maximum likelihood estimates are
The centre is estimated by the median, not the mean, because the likelihood penalises the absolute distance. This is the reason robust estimation uses the median for this model.
Worked examples
Take and , so .
- The density at the centre: .
- The density at : .
- The chance of a value above 1: . This is half of the two-sided tail in step 4.
- The chance of a value more than 1 away from 0: .
- Interpretation: about 37 percent of values lie outside the interval from to . The peak at 0 is times the density at , which is exactly, because divided by is .
Five measurements: 1, 2, 4, 7, 11. Assume they are Laplace.
- Sort the data: 1, 2, 4, 7, 11. The median is the middle value, .
- Find the distance of each point from 4: , , , , .
- Add the distances: .
- Divide by : .
- Check: the sample mean of the data is , which is pulled up by the 11. The median 4 is not, and that is why it is the centre estimate here.
- Interpretation: the typical distance from the centre is 3 units.
A clinic wants to publish how many visitors it had last month, which is 50, without letting anyone infer whether a particular person visited. A count changes by at most 1 when one person is added or removed. The Laplace mechanism adds noise from with , where (epsilon) sets the privacy level. Take .
- Compute the scale: .
- The published value is , where is a draw from .
- The chance that the noise is larger than 3 in size is , using the tail formula with and .
- Evaluate: .
- Interpretation: about 22 percent of the time the published number is more than 3 away from the true 50. The count is still informative, and a single visitor changes the output distribution only by a bounded amount.
Try it: the same clinic uses instead, so . What is the chance that the noise is larger than 2 in size? Answer: .
Common mistakes and tradeoffs
It is tempting to think the Laplace is just a Gaussian with pointier peak. In fact its tails decay exponentially in , while a Gaussian's decay like . So a Laplace model expects large values far more often than a Gaussian with the same typical size, and a model fitted with the wrong one underestimates extreme events.
It is tempting to estimate the centre with the sample mean. In fact the maximum likelihood estimate is the median, because the likelihood depends on the absolute distance from the centre. In Example 2 the mean is 5 and the median is 4, and the outlier 11 moves only the mean.
It is tempting to read as a standard deviation. In fact is the mean absolute deviation, and the standard deviation is . Mixing them up changes every noise level and every penalty built from the scale.
The Laplace is a good choice when data have a sharp centre and occasional large values, when a robust centre is wanted, or when a sparse penalty or a pure-privacy mechanism is needed. It is a poor choice when the data are close to Gaussian, since the Gaussian then fits better, or when the variance itself is the quantity of interest, since the variance is and depends on the tails. Alternatives include the Gaussian, the Student-t for heavy tails with a smoother centre, and the Gaussian mechanism in privacy.
History
Pierre-Simon Laplace studied error distributions in the late 18th century and discussed a double-exponential form when comparing ways of combining observations.
The Laplace mechanism for privacy was introduced in 2006 by Cynthia Dwork and colleagues, who showed that adding noise scaled to how much one person can change a query gives a precise privacy guarantee. That made the distribution a standard tool in the field.
The lasso of Robert Tibshirani in 1996 put an absolute-value penalty on coefficients, which is closely linked to the Laplace prior. This link made the distribution central to sparse modelling.
Recap
- The Laplace distribution is a sign times an exponential wait, so its density is .
- It is symmetric, with centre equal to the mean and the median.
- Its tails fall off as , heavier than a Gaussian's, and its mean absolute deviation is .
- Its maximum likelihood centre is the median, and its scale is the mean absolute distance from it.
- Read next: Differential Privacy for the noise mechanism, and Lasso Regression for the sparse penalty.
Check yourself
QuestionWhat are the two parts of a Laplace random variable built from, and what does the sign do?Show answer
A Laplace variable is a random sign times an exponential wait. The sign is or with equal chance, so the distribution is symmetric about the centre, and the exponential wait sets the size of the value.
QuestionA Laplace variable has centre 0 and scale . What is ?Show answer
The tail formula gives . With and , .
QuestionWhy does the maximum likelihood estimate of the centre use the median rather than the mean?Show answer
The likelihood is built from , the absolute distance. Maximising it makes the value that minimises the sum of absolute distances, and that value is the median. The mean minimises squared distances, so it is pulled by large values in a way the Laplace likelihood does not reward.
QuestionA researcher says the Laplace and Gaussian with the same standard deviation behave the same for large values. Is this right?Show answer
No. With the same standard deviation, the Laplace has a sharper peak and heavier tails, so it puts more probability on large values. The tails decay like for the Laplace and like up to constants for the Gaussian, so they differ most in the tails.