Course contentsShow
← Data Science
Lesson 1535 of 2,14538. Bayesian Data AnalysisFree lesson

The Likelihood Function

Defining how probable the observed data is under different parameter values.

The Likelihood Function

What you'll learn: How to quantify how well different parameter values explain your observed data in Bayesian analysis.

The Core Idea

The likelihood function is a mathematical expression that tells us how probable our observed data is under different parameter values. Think of it as scoring each possible explanation: "If the true parameter were this value, how likely would I be to see the data I actually got?"

This is not asking "what's the probability that the parameter equals X?" — that's what the posterior gives us. Instead, the likelihood asks: "given parameter X, how probable is my data?"

An Intuitive Analogy

Imagine you flip a coin 10 times and get 7 heads. The likelihood function evaluates different possible "fairness levels" of the coin:

  • If the coin were fair (50% heads): How likely are 7 heads out of 10?
  • If the coin favored heads (70% heads): How likely are 7 heads out of 10?
  • If the coin strongly favored tails (20% heads): How likely are 7 heads out of 10?

The likelihood function computes these probabilities for every possible parameter value. The parameter that makes your observed data most probable has the highest likelihood.

Mathematical Notation

We write the likelihood as:

L(θ | data) or P(data | θ)

Read as: "the likelihood of parameter θ given the data" or "the probability of the data given θ."

Note the direction: the data is fixed (you already observed it), and θ varies. We're scanning through possible parameter values to see which ones make our data most plausible.

Key Takeaway: The likelihood function measures how well different parameter values explain your observed data — it's the bridge between what you saw and what different theories predict you should have seen.