ArticleslgStudy

mathematics

Marginal likelihood

Marginal likelihood is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Marginal likelihood rather than just read about it. In short: A marginal likelihood is a likelihood function that has been integrated over the parameter space. In Bayesian statistics, it represents the probability of generating the observed sample for all possible values of the parameters; it can be understood as the probability of the model itself and is therefore often referred to as model evidence or simply evidence.

Marginal likelihood — main illustration
Marginal likelihood — illustration

Key takeaways

  • Marginal likelihood belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Marginal likelihood to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Marginal likelihood from memory before moving on to harder problems.

Reference excerpt

A marginal likelihood is a likelihood function that has been integrated over the parameter space. In Bayesian statistics, it represents the probability of generating the observed sample for all possible values of the parameters; it can be understood as the probability of the model itself and is therefore often referred to as model evidence or simply evidence. Due to the integration over the parameter space, the marginal likelihood does not directly depend upon the parameters. If the focus is not on model comparison, the marginal likelihood is simply the normalizing constant that ensures that the posterior is a proper probability. It is related to the partition function in statistical mechanics.

Concept Given a set of independent identically distributed data points 𝐗=(x1,…,xn), where xi∼p(x|θ) according to some probability distribution parameterized by θ, where θ itself is a random variable described by a distribution, i.e. θ∼p(θ∣α), the marginal likelihood in general asks what the probability p(𝐗∣α) is, where θ has been marginalized out (integrated out):

p(𝐗∣α)=∫θp(𝐗∣θ)p(θ∣α) d⁡θ The above definition is phrased in the context of Bayesian statistics in which case p(θ∣α) is called prior density and p(𝐗∣θ) is the likelihood. Recognizing that the marginal likelihood is the normalizing constant of the Bayesian posterior density p(θ∣𝐗,α), one also has the alternative expression

p(𝐗∣α)=p(𝐗∣θ,α)p(θ∣α)p(θ∣𝐗,α) which is an identity in θ. The marginal likelihood quantifies the agreement between data and prior in a geometric sense made precise via Hilbert spaces in de Carvalho et al. (2019). In classical (frequentist) statistics, the concept of marginal likelihood occurs instead in the context of a joint parameter θ=(ψ,λ), where ψ is the actual parameter of interest, and λ is a non-interesting nuisance parameter. If there exists a probability distribution for λ, it is often desirable to consider the likelihood function only in terms of ψ, by marginalizing out λ:

ℒ(ψ;𝐗)=p(𝐗∣ψ)=∫λp(𝐗∣λ,ψ)p(λ∣ψ) d⁡λ Unfortunately, marginal likelihoods are generally difficult to compute. Exact solutions are known for a small class of distributions, particularly when the marginalized-out parameter is the conjugate prior of the distribution of the data. In other cases, some kind of numerical integration method is needed, either a general method such as Gaussian integration or a Monte Carlo method, or a method specialized to statistical problems such as the Laplace approximation, Gibbs/Metropolis sampling, or the EM algorithm. It is also possible to apply the above considerations to a single random variable (data point) x, rather than a set of observations. In a Bayesian context, this is equivalent to the prior predictive distribution of a data point.

Applications

Bayesian model comparison In Bayesian model comparison, the marginalized variables θ are parameters for a particular type of model, and the remaining variable M is the identity of the model itself. In this case, the marginalized likelihood is the probability of the data given the model type, not assuming any particular model parameters. Writing θ for the model parameters, the marginal likelihood for the model M is

p(𝐗∣M)=∫p(𝐗∣θ,M)p(θ∣M)d⁡θ It is in this context that the term model evidence is normally used. This quantity is important because the posterior odds ratio for a model M1 against another model M2 involves a ratio of marginal likelihoods, called the Bayes factor:

p(M1∣𝐗)p(M2∣𝐗)=p(M1)p(M2)p(𝐗∣M1)p(𝐗∣M2) which can be stated schematically as

posterior odds = prior odds × Bayes factor

See also Empirical Bayes methods Lindley's paradox Marginal probability Bayesian information criterion

References

Further reading Charles S. Bos. "A comparison of marginal likelihood computation methods". In W. Härdle and B. Ronz, editors, COMPSTAT 2002: Proceedings in Computational Statistics, pp. 111–117. 2002. (Available as a preprint on SSRN 332860) de Carvalho, Miguel; Page, Garritt; Barney, Bradley (2019). "On the geometry of Bayesian inference". Bayesian Analysis. 14 (4): 1013‒1036. (Available as a preprint on the web: [1]) Lambert, Ben (2018). "The devil is in the denominator". A Student's Guide to Bayesian Statistics. Sage. pp. 109–120. ISBN 978-1-4739-1636-4. The on-line textbook: Information Theory, Inference, and Learning Algorithms, by David J.C. MacKay.

Worked examples

Example 1 — a first encounter with Marginal likelihood

Start with the simplest possible case. Write down what Marginal likelihood claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Marginal likelihood before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Marginal likelihood ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Marginal likelihood

In research
Marginal likelihood appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Marginal likelihood in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Marginal likelihood is common in secondary-school and first-year university syllabi. It links to neighbouring topics Bayesian statistics, so understanding it makes those chapters shorter.
In everyday life
Look for Marginal likelihood outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Marginal likelihood” →

How to study Marginal likelihood in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Marginal likelihood means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Marginal likelihood out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Marginal likelihood in simple terms?

A marginal likelihood is a likelihood function that has been integrated over the parameter space. In Bayesian statistics, it represents the probability of generating the observed sample for all possible values of the parameters; it can be understood as the probability of the model itself and is the…

Why does Marginal likelihood matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Marginal likelihood?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Marginal likelihood.

Tags

  • Bayesian statistics

Keep exploring