Skip to main content

Camel that is the likelihood

Building and checking models
Principle or heuristic
Advanced
What skeptics and subjectivists alike swallow while straining on the gnat of the prior distribution.
Published

November 9, 2026

Modified

November 13, 2026

What it is

The phrase echoes “straining at a gnat and swallowing a camel.” Debates about Bayesian statistics focus on the prior: is it subjective, is it justified, how sensitive are the results to it? Meanwhile the likelihood, the data model, is accepted with little scrutiny. Yet the likelihood typically encodes far stronger assumptions: normal errors, independence, linearity, a particular link function, no measurement error. Those assumptions often matter far more than the prior.

Why it matters

Sensitivity analyses that vary the prior while keeping the likelihood fixed can give false reassurance: our results are robust to the prior! Meanwhile a single outlier or a heavy-tailed error distribution can change the conclusion entirely under a different but equally reasonable likelihood. Frequentist methods also rest on likelihoods, or equivalent assumptions, so the camel is swallowed on both sides of the debate.

How it works

Take estimating a location parameter from data that contain a few outliers. Changing the prior on the location from \(\mathrm{N}(0, 1)\) to \(\mathrm{N}(0, 10)\) hardly moves the posterior when \(n\) is moderate. Changing the likelihood from normal to Student-\(t\) with 3 degrees of freedom can move it a lot, because the normal likelihood lets outliers pull the estimate while the \(t\) likelihood down-weights them.

Simulated example

Data come from a normal distribution centered at 1, with a few gross outliers added. Compute the posterior mean under two priors × two likelihoods (by grid approximation) and compare how much each choice matters.

Show simulation code

The R version uses base R, and the Python version uses NumPy and Matplotlib. Where the simulation draws random numbers, each language draws its own, so exact numbers differ slightly but show the same pattern. The numbered markers in the R code are explained under it.

import {rng, range, dnorm, fmt} from "../js/stats.js"

viewof nOut = Inputs.range([0, 8], {value: 3, step: 1, label: "Number of outliers"})
viewof outSize = Inputs.range([2, 20], {value: 10, step: 1, label: "Outlier size"})
viewof seed = Inputs.range([1, 500], {value: 99, step: 1, label: "Random seed"})

camel = {
  const r = rng(seed);
  const y = [...r.normals(30, 1, 1), ...range(nOut).map(() => outSize + r.normal(0, 1))];
  const grid = range(801).map(i => -4 + i * 0.02);
  const logT3 = z => -2 * Math.log(1 + z * z / 3);
  const post = (priorSd, like) => {
    const lp = grid.map(m => Math.log(dnorm(m, 0, priorSd)) + y.reduce((s, v) => s + (like === "Normal" ? -0.5 * (v - m) ** 2 : logT3(v - m)), 0));
    const mx = Math.max(...lp), w = lp.map(v => Math.exp(v - mx)), tot = w.reduce((a, b) => a + b, 0);
    return w.reduce((s, wi, i) => s + wi * grid[i], 0) / tot;
  };
  return ["Normal", "Student-t (3 df)"].flatMap(like => [1, 10].map(ps => ({like, prior: `Prior N(0, ${ps})`, mean: post(ps, like)})));
}

Plot.plot({
  ariaLabel: "Camel that is the likelihood: simulation chart",
  ariaDescription: "Horizontal axis: Posterior mean of the location (truth = 1). The chart updates with the controls above it, and the summary below the charts states the result in words.",
  height: 220,
  marginLeft: 120,
  fy: {label: null},
  x: {label: "Posterior mean of the location (truth = 1)", grid: true},
  y: {label: null},
  color: {legend: true, range: ["#2166ac", "#d6604d"]},
  marks: [Plot.dot(camel, {fy: "like", y: "prior", x: "mean", fill: "prior", r: 7}), Plot.ruleX([1], {stroke: "currentColor", strokeDasharray: "4 3"})]
})
# The camel that is the likelihood: the data model outweighs the prior.
1n_out <- 3 # number of outliers
out_size <- 10 # outlier size
2set.seed(99)

3y <- c(rnorm(30, 1, 1), out_size + rnorm(n_out))
grid <- seq(-4, 12, by = 0.02) # grid of values for the mean
4post_mean <- function(prior_sd, likelihood) {
  loglik <- sapply(grid, function(m) {
    if (likelihood == "normal") {
      sum(dnorm(y, m, 1, log = TRUE))
    } else {
      sum(dt(y - m, df = 3, log = TRUE))
    }
  })
  lp <- dnorm(grid, 0, prior_sd, log = TRUE) + loglik
  w <- exp(lp - max(lp))
  sum(w * grid) / sum(w)
}
5res <- sapply(c(1, 10), function(s) {
  sapply(
    c("normal", "t3"),
    function(l) post_mean(s, l)
  )
})
colnames(res) <- c("prior sd 1", "prior sd 10")
print(round(res, 3)) # posterior means
cat(
  "Changing the prior moves the estimate by",
  round(abs(res["normal", 1] - res["normal", 2]), 3), "(the gnat)\n"
)
cat(
  "Changing the likelihood moves it by",
  round(abs(res["normal", 2] - res["t3", 2]), 3), "(the camel)\n"
)

6barplot(res,
  beside = TRUE, col = c("#d6604d", "#2166ac"),
  ylab = "Posterior mean",
  legend.text = c("Normal", "Student-t (3 df)")
)
1
The page’s controls: how many outliers there are and how far out they sit.
2
Fixes the random numbers so the run is reproducible.
3
Thirty ordinary observations plus a few outliers.
4
The posterior mean of the location, computed on a grid, under a normal or a Student-t likelihood and a normal prior of the given width.
5
All four combinations: two priors by two likelihoods.
6
Changing the prior barely moves the estimate (the gnat). Changing the likelihood moves it a lot (the camel).
# The camel that is the likelihood: the data model outweighs the prior.
import math
import numpy as np
import matplotlib.pyplot as plt

n_out = 3      # number of outliers
out_size = 10  # outlier size
rng = np.random.default_rng(99)

y = np.concatenate([rng.normal(1, 1, 30), out_size + rng.normal(size=n_out)])
grid = np.arange(-4, 12.001, 0.02)  # grid of values for the mean


def post_mean(prior_sd, likelihood):
    z = y[None, :] - grid[:, None]
    if likelihood == "normal":
        loglik = (-0.5 * z ** 2).sum(axis=1)
    else:  # Student-t with 3 degrees of freedom (up to a constant)
        loglik = (-2 * np.log1p(z ** 2 / 3)).sum(axis=1)
    lp = -0.5 * (grid / prior_sd) ** 2 + loglik
    w = np.exp(lp - lp.max())
    return (w * grid).sum() / w.sum()


res = {(l, s): post_mean(s, l) for l in ("normal", "t3") for s in (1, 10)}
for (l, s), m in res.items():
    print(f"{l:6s} likelihood, prior sd {s:2d}: posterior mean {m:.3f}")
print(f"Changing the prior moves the estimate by "
      f"{abs(res['normal', 1] - res['normal', 10]):.3f} (the gnat)")
print(f"Changing the likelihood moves it by "
      f"{abs(res['normal', 10] - res['t3', 10]):.3f} (the camel)")

x = np.arange(2)
plt.bar(x - 0.2, [res["normal", 1], res["normal", 10]], 0.4,
        color="#d6604d", label="Normal")
plt.bar(x + 0.2, [res["t3", 1], res["t3", 10]], 0.4, color="#2166ac",
        label="Student-t (3 df)")
plt.xticks(x, ["Prior sd 1", "Prior sd 10"])
plt.ylabel("Posterior mean")
plt.legend()
plt.show()

Key takeaways

  • The likelihood usually carries stronger assumptions than the prior.
  • Do sensitivity analysis on the data model, not just the prior.
  • Robust likelihoods, model checking and measurement models deserve as much scrutiny as priors.

Source

Back to top