Probability · distributions Section 1.3 · item 24 of 33

The Laplace
distribution

Take the Gaussian and replace the squared distance with an absolute one. That single change gives you a sharper peak, far heavier tails, a median where the mean used to be, and — because the peak is a corner rather than a curve — the ability to shrink a coefficient to exactly zero.

Two exponentials placed back to back. Also called the double exponential, and the reason L1 regularization does something categorically different from L2.

Side by side

Laplace: f ∝ exp(|xμ|b)
Gaussian: f ∝ exp((xμ2σ²)

The exponent is the whole difference. Absolute value against square — everything below follows from it.

Switch to log scale. That's where it lives.

Both distributions below have exactly the same variance, which is the only fair way to compare them. On a linear axis they look similar. On a log axis the Laplace is two straight lines and the Gaussian is a parabola bending away — and that difference is the entire story of tail weight.

Laplace · b = σ/√2 Gaussian · σ = 1 threshold ±k
3.00σ
P(|X| > kσ) — Laplace
P(|X| > kσ) — Gaussian
Laplace is this many times more likely out there
Extreme draws in the sample

Push k past 5σ and the ratio runs into the thousands. Pull it back below about 1.65σ and it flips — the Laplace is less likely to be there, because it packs more mass into the middle.

01The shape

Two exponentials, back to back

f(x) = 12b exp(|xμ|b)

Parameters

μ
Location. Simultaneously the mean, the median, and the mode. The distribution is perfectly symmetric about it.
b
Scale, sometimes called the diversity. Larger b means flatter and wider. Note it is not the standard deviation.
σ = b√2
The standard deviation. Variance is 2b², so to compare fairly against a Gaussian of standard deviation σ you need b = σ/√2.
b = MAD
The scale parameter is the mean absolute deviation from the centre — a much more direct interpretation than the Gaussian's σ.

Why "double exponential"

For x above μ it's an exponential decaying to the right. For x below μ it's the mirror image. Glue them at μ, halve the height so the total area is one, and you have it.

Equivalently: if E1 and E2 are independent exponentials with the same rate, then E1E2 is Laplace. Any process that is the difference of two waiting times lands here naturally.

The corner is not a rendering artifact. The density has a genuine kink at μ — it is continuous but not differentiable there. That single non-differentiable point is responsible for both the sparsity in Lasso and the need for specialized optimizers to fit it.
02Properties

The numbers, against the Gaussian

PropertyLaplace(μ, b)Normal(μ, σ²)
density kernelexp(−|x−μ| / b)exp(−(x−μ)² / 2σ²)
meanμμ
medianμμ
modeμ (a corner)μ (smooth)
variance2b²σ²
peak height1 / 2b ≈ 0.354/σ1 / σ√(2π) ≈ 0.399/σ
skewness00
excess kurtosis30
mean abs deviationb = σ/√2σ√(2/π) ≈ 0.798σ
entropy1 + ln(2b)½ ln(2πeσ²)
tail P(|X−μ| > t)exp(−t / b) — exponential2(1 − Φ(t/σ)) — Gaussian
maximum entropy forfixed mean absolute deviationfixed variance
MLE of locationthe medianthe mean
differentiable at μnoyes
The maximum-entropy pairing is the cleanest way to remember the relationship. If all you know about a quantity is its variance, the least-committal distribution is Gaussian. If all you know is its mean absolute deviation, it's Laplace. The two distributions are answers to the same question asked with a different notion of distance — and the same swap turns squared-error loss into absolute-error loss and ridge into lasso.
Excess kurtosis 3 is the standard summary of the tail weight, and it deserves a caveat: kurtosis is a single number computed from fourth moments, and it can be dominated by a handful of extreme values. It's a useful label, not a diagnosis. The log-density plot in the hero tells you far more about what the tail is actually doing.
03The tails

Straight lines against a parabola

The log density is where the difference becomes structural rather than cosmetic. Take logs of both kernels and you get −|x−μ|/b against −(x−μ)²/2σ². One is linear in distance; the other is quadratic. So on a log axis the Laplace descends at a constant rate forever, while the Gaussian's descent steepens without limit.

kLaplace P(|X| > kσ)Gaussian P(|Z| > k)ratioreading
10.2430.3170.77×Gaussian is more likely here
1.65≈0.096≈0.099≈1×the crossover point
20.0590.04551.3×Laplace overtakes
30.01430.002705.3×a clear gap
40.003496.3 × 10⁻⁵55×different regimes
58.5 × 10⁻⁴5.7 × 10⁻⁷1,480×a once-in-a-lifetime Gaussian event is routine
62.1 × 10⁻⁴2.0 × 10⁻⁹105,000×the Gaussian has effectively stopped
The crossover at about 1.65σ is the fact people miss. "Heavier tails" is often heard as "more spread out everywhere", and it isn't. At matched variance the Laplace is more concentrated near the centre and more likely far out — it borrows the mass from the shoulders. That is precisely the shape of a prior that says "probably almost exactly zero, but occasionally very large", which is the belief that produces sparse solutions.
Still not heavy enough for everything. The Laplace tail decays exponentially, which is far slower than Gaussian but far faster than a power law. Financial returns, city sizes and network degrees generally need Student-t, Cauchy or Pareto. The Laplace occupies a useful middle ground: robust to outliers, but with all moments finite and a well-defined moment generating function.
04The median

Where robustness comes from

Assume Gaussian noise and maximum likelihood hands you the sample mean. Assume Laplace noise and the very same procedure hands you the sample median. That substitution is the entire mathematical content of "robust estimation".

The two loss functions · and what one outlier does to each
−log Gaussian ∝ ∑ (xiμ)²  ⟹  μ̂ = mean
−log Laplace ∝ ∑ |xiμ|  ⟹  μ̂ = median

Minimizing squared distances gives the mean; minimizing absolute distances gives the median. Both are one-line calculus exercises, and together they explain why one estimator is dragged by outliers and the other isn't.

The mechanism, precisely. Squared error's derivative grows without bound, so a point that is ten units away pulls ten times harder than one a single unit away. Absolute error's derivative is ±1 everywhere — every point pulls with identical force regardless of distance. An outlier gets exactly one vote, which is what makes the median immune to it.

Scale estimate: the MLE for b is the mean absolute deviation from the fitted median, b̂ = (1/n)Σ|xᵢ − median|. Note it uses the median, not the mean — plugging in the mean is a common and quietly damaging error.

05L1 & sparsity

Why the corner produces exact zeros

A MAP estimate maximizes prior times likelihood, which after taking logs becomes a penalized least-squares problem. The penalty is just the negative log prior — so choosing a prior is choosing a regularizer.

Gaussian prior → Ridge

−log p(β) ∝ ∑ βj²

Smooth everywhere, with derivative that vanishes as β approaches zero. The penalty stops pushing exactly when it would need to push hardest, so coefficients shrink toward zero and never arrive.

Laplace prior → Lasso

−log p(β) ∝ ∑ |βj|

Derivative ±1 right up to zero, where it is undefined. The penalty keeps pushing with full force all the way in — so if the data's pull is weaker than λ, the coefficient is pinned at exactly zero.

The shrinkage operator

0.70
no penalty · identity ridge · β/(1+λ) lasso · soft threshold
Input coefficient in, penalized coefficient out
Read the amber line. There is a flat interval around zero — the dead zone of width 2λ — where every input maps to exactly zero. Outside it, the coefficient survives but is shifted toward the origin by a constant λ. That is soft thresholding, and it is the closed-form solution to the one-dimensional lasso problem. Widen λ and watch the dead zone eat more coefficients.
Ridge has no dead zone at any λ. The grey line is a straight line through the origin with slope 1/(1+λ). It gets arbitrarily shallow but never flat, so no coefficient is ever exactly zero. Ridge shrinks; only lasso selects. The difference is entirely due to the shape of the prior at the origin.
# the correspondence, made explicit
#   posterior ∝ likelihood × prior
#   −log posterior = −log likelihood − log prior
#                  =  RSS / (2σ²)   +   Σ|β_j| / b   + const
#   minimize:         RSS           +   λ Σ|β_j|      with λ = 2σ²/b

# so a TIGHT Laplace prior (small b) means STRONG regularization (large λ)
# and the lasso path is a path through prior strengths, not just penalties

from sklearn.linear_model import Lasso, Ridge
Lasso(alpha=0.1)      # MAP under a Laplace prior  → some coefficients exactly 0
Ridge(alpha=0.1)      # MAP under a Gaussian prior → all coefficients merely smaller
One honest limitation of the correspondence. The MAP estimate under a Laplace prior is sparse, but the full posterior mean is not — a continuous posterior assigns zero probability to any exact value, including zero. Lasso's sparsity is a property of the mode, not of the posterior. That gap is what section 06 is about.
06Bayesian lasso

The full posterior version

The scale-mixture trick

A Laplace distribution can be written as a Gaussian whose variance is itself exponentially distributed. Marginalize the variance out and the Laplace reappears.

That representation is what makes the Bayesian lasso practical: conditional on the latent variances, everything is Gaussian and conjugate, so a Gibbs sampler alternates between drawing coefficients and drawing variances. Park and Casella's 2008 formulation is the standard reference.

What you gain, and what you don't

  • Gain: credible intervals for every coefficient, which the lasso point estimate cannot give you — its sampling distribution is notoriously awkward.
  • Gain: λ can be given a prior and inferred rather than cross-validated.
  • Lose: exact sparsity. Nothing is ever precisely zero, so you need a thresholding rule to declare selection.
  • Lose: speed. Coordinate descent fits a lasso in milliseconds; MCMC takes minutes.
Modern Bayesian practice has largely moved past the Laplace prior. Its tails, while heavy relative to a Gaussian, are still exponential — which means genuinely large coefficients get shrunk more than they should be, at the same time as small ones aren't shrunk enough. The horseshoe and other global-local shrinkage priors have an infinite spike at zero and polynomial tails, so they can crush noise while leaving real signal essentially untouched. If you want sparsity from a proper Bayesian model today, that's the family to look at — the Laplace is the historically important stepping stone.
07Robust regression

Absolute-error loss, from the other direction

Section 05 put the Laplace on the coefficients. Put it on the residuals instead and you get a different and equally useful model.

Noise assumptionLoss it impliesEstimatorBehaviour
Gaussiansquared errorOLSEfficient if true, dragged badly by outliers
Laplaceabsolute errorLeast absolute deviationsRobust, fits the conditional median, no closed form
Asymmetric Laplacepinball / check lossQuantile regressionFits any conditional quantile you name
Gaussian centre, Laplace tailsHuber lossHuber regressionThe practical compromise, and usually the right default
Student-ta bounded influence losst-regressionEven more robust; extreme points get almost no vote
The asymmetric Laplace connection is worth knowing. Skew the two exponential halves so one decays faster than the other, and the negative log-likelihood becomes exactly the pinball loss used in quantile regression. Every quantile forecast — the p10 and p90 you'd report as a prediction interval — is a maximum-likelihood fit under an asymmetric Laplace. It's also the loss used by quantile gradient boosting.
Absolute error is not differentiable at zero either, so LAD regression cannot be solved by the normal equation and needs linear programming or iteratively reweighted least squares. Huber loss exists largely to restore differentiability: quadratic within a threshold, linear beyond it, so you get robustness without abandoning gradient methods.
08Privacy

The Laplace mechanism

The distribution's most consequential modern application isn't statistical at all. Differential privacy needs noise whose ratio of densities at two nearby points is bounded — and because the Laplace's log density is linear in distance, that ratio depends only on the gap between them. No other common distribution has that property so cleanly.

release f(D) + Laplace(0, Δε)  ⟹  ε-differential privacy
0.50
127
Noise scale b = Δ/ε
Typical error
Twenty independent releases of the same counting query · sensitivity Δ = 1

The two knobs

Δ
Sensitivity. The most the answer could change if one person's record were added or removed. For a simple count that's 1.
ε
Privacy budget. Small ε means strong privacy and loud noise. Large ε means the reverse. It is a ratio bound on how much any single person can influence the output distribution.

Drag ε down and watch the releases scatter until the true count is unrecoverable. That is the guarantee working as designed, not a defect.

Why the exponential tail is exactly what's needed. The privacy guarantee requires the ratio of output densities under two neighbouring datasets to be bounded by e^ε. Because the Laplace log-density is linear in distance, shifting the centre by Δ changes the log density by at most Δ/b everywhere — a constant. A Gaussian's quadratic log-density gives a ratio that grows without limit in the tails, which is why the Gaussian mechanism only achieves the weaker (ε, δ) variant.
Budget composes, and that's the hard part in practice. Ask k questions and the privacy costs add up. Real deployments spend a great deal of effort on accounting for the total budget across every query a system will ever answer.
09Relatives

Where it sits among the heavy-tailed distributions

Log density · matched interquartile scale · straighter and flatter means heavier
DistributionTail decayNotes
Normalexp(−x²)The reference. All moments finite, tails effectively vanish past 5σ
Laplaceexp(−|x|)All moments still finite, MGF exists. Robust but not extreme
Student-t (ν)|x|−(ν+1)Power law. Moments above ν don't exist. Tunable via ν
Cauchy|x|−2t with ν = 1. No mean, no variance. The sample mean never converges
Paretox−αOne-sided. Wealth, city sizes, file sizes

Asymmetric Laplace

Different scales either side of μ. The likelihood behind quantile regression and expectile methods.

Log-Laplace

The exponential of a Laplace variable. Positive-valued with a power-law tail — used for income and insurance losses.

Geometric stable

The Laplace is the geometric-stable analogue of the Gaussian: sums of a geometrically distributed number of iid terms converge to it.

10In code

Sampling, fitting, using

import numpy as np
from scipy import stats

# sampling — three equivalent routes
x = np.random.laplace(loc=0, scale=b, size=n)          # the direct way
x = stats.laplace(loc=0, scale=b).rvs(n)
u = np.random.uniform(-0.5, 0.5, n)                    # inverse CDF, by hand
x = -b * np.sign(u) * np.log(1 - 2*np.abs(u))
x = np.random.exponential(b, n) - np.random.exponential(b, n)  # difference of two

# fitting — note the estimators are the median and the MAD-about-median
mu_hat = np.median(x)
b_hat  = np.mean(np.abs(x - mu_hat))
loc, scale = stats.laplace.fit(x)          # the same thing, done for you

# matching a Gaussian's variance requires the √2
sigma = 1.0
b_matched = sigma / np.sqrt(2)             # NOT b = sigma

# which distribution actually fits? compare on the log scale, not the density
for dist in (stats.norm, stats.laplace, stats.t):
    params = dist.fit(x)
    ll = dist.logpdf(x, *params).sum()
    k  = len(params)
    print(dist.name, "AIC", 2*k - 2*ll)

# a QQ plot against Laplace is the honest visual check
stats.probplot(x, dist=stats.laplace, plot=plt)
When to reach for it. Residuals with more extreme values than a Gaussian would produce but still with finite variance. Differences of two similar quantities. Sparsity-inducing priors. Differential privacy. And any time you find yourself using absolute error as a loss — you have already assumed it, whether or not you said so.
How to check. Never judge tail fit from a histogram or a density plot; the region that matters holds too little mass to see. Use a QQ plot, or plot the empirical log density and look for straight lines against a parabola. That's the same comparison the hero is making.
11Practice

Drills

#Do thisYou'll know it when
1Derive the variance 2b² by integration, and confirm b = σ/√2You stop confusing the scale parameter with the standard deviation
2Sample 10,000 draws from a Laplace and a variance-matched Gaussian; count values past 4σ in eachThe counts differ by roughly the factor the table predicts
3Plot both empirical log densities and find the crossoverIt lands near 1.65σ, and you can explain why the middle matters too
4Prove that minimizing Σ|x−μ| gives the medianRobustness is a derivative argument in your head, not a slogan
5Implement soft thresholding and verify it solves the 1D lassoThe dead zone is a formula, not a picture
6Fit lasso and ridge on the same data across a λ path; plot both coefficient pathsYou watch lasso coefficients hit zero and ridge coefficients never do
7Fit OLS and LAD to data with one large outlier and compare the fitted linesThe vote-weighting argument becomes concrete
8Implement the Laplace mechanism for a counting query and empirically check the density ratio boundYou see why the exponential tail is load-bearing
9Fit Normal, Laplace and Student-t to a real dataset and compare by AIC and QQ plotYou pick a noise model from evidence rather than habit

The one-paragraph summary

The Laplace distribution replaces the Gaussian's squared distance with an absolute one, making its density two exponentials joined at a corner. At matched variance it is more concentrated near the centre and substantially heavier beyond about 1.65σ — at five standard deviations it is roughly 1,500 times more likely than a Gaussian — while still having all moments finite, which places it between the Gaussian and genuinely power-law distributions. Because minimizing absolute rather than squared deviations gives the median rather than the mean, assuming Laplace noise yields robust estimators in which every observation carries equal weight regardless of distance. Used as a prior on coefficients its negative log becomes the L1 penalty, and because the derivative stays at ±1 all the way to the origin rather than vanishing, the resulting MAP estimate soft-thresholds: coefficients whose evidence is weaker than λ are set to exactly zero, which is why lasso selects and ridge merely shrinks. And because its log density is linear in distance, the ratio of densities at two nearby points is bounded by a constant — the property that makes it the noise distribution of choice for ε-differential privacy.