Bring the mental model from Distributions; this page will reuse it instead of restarting from zero.
Bayesian Inference
Bayesian inference updates a prior distribution over unknowns into a posterior by multiplying by the likelihood and normalizing.
01
Intuition
Build the mental picture first so the rest of the page has something to attach to.
Maximum likelihood asks: which parameter makes the data look most probable?
Bayesian inference asks a different question: after seeing the data, what should we believe about each possible parameter?
That difference matters when data is scarce or uncertainty matters. The likelihood is a score of parameters by data fit. A prior is what you believed before the data. A posterior is the updated distribution after both forces are combined.
For a coin with unknown head probability θ, maximum likelihood might pick one number such as θ^=0.8. Bayesian inference keeps a whole distribution over plausible θ values. With little data, the prior can still matter. With lots of data, and with a prior that gives nonzero density near the data-favored values, the likelihood usually concentrates the posterior near the parameters that explain the observations.
The mental model is not "Bayes is MLE plus vibes." It is a different object: MLE returns an estimate, while Bayesian inference returns a distribution over the unknown quantity.
Copy-only prompts — each action copies a page-grounded prompt to your clipboard. Nothing is sent by this site.
02
Math
Translate the story into symbols, assumptions, and a derivation you can inspect.
Let θ∈Θ be an unknown parameter and let D be observed data. Bayesian inference starts with a prior distribution or density p(θ) and a likelihood p(D∣θ). Bayes' rule gives the posterior:
For a continuous parameter, the denominator
is the evidence or marginal likelihood. Its job is to normalize the posterior so it integrates to 1.
If θ lives in a discrete set, replace the integral with a sum. The job is the same: add up prior-weighted likelihood over all possible parameter values.
For parameter comparison, the key proportional form is
This is the central contrast with maximum likelihood. The likelihood p(D∣θ) is a function of θ, but it is not automatically a probability distribution over θ. Multiplying by a prior and normalizing turns it into the posterior distribution.
For a coin with unknown head probability θ∈[0,1], suppose the data has h heads and t tails, with n=h+t. The likelihood shape is
If D records only the count of heads, the full binomial likelihood also has a factor (hn). That factor does not depend on θ, so it disappears in proportional calculations.
If the prior is a beta distribution with α,β>0,
then
Multiplying prior and likelihood gives
so the posterior is
The maximum-likelihood estimate is
when h+t>0. The posterior mean is
When n>0, the posterior mean can also be written as
This is the clean bridge to maximum likelihood: the posterior mean is a weighted compromise between the prior mean and the MLE. The posterior distribution is the richer object; the mean is only one summary of it.
It is safe to think of α+β as prior strength for this averaging formula. The density exponents are α−1 and β−1, so pseudo-count language is only a mnemonic. The exact conjugate update is the parameter update Beta(α,β)→Beta(α+h,β+t).
Copy-only prompts — each action copies a page-grounded prompt to your clipboard. Nothing is sent by this site.
03
Code
Keep the implementation aligned with the notation so the algorithm is legible.
import math
import numpy as np
def log_beta_fn(a, b):
return math.lgamma(a) + math.lgamma(b) - math.lgamma(a + b)
def log_beta_pdf(theta, a, b):
if theta <= 0 or theta >= 1:
return -math.inf
return (a - 1) * math.log(theta) + (b - 1) * math.log(1 - theta) - log_beta_fn(a, b)
alpha, beta = 2.0, 2.0
heads, tails = 8, 2
post_alpha = alpha + heads
post_beta = beta + tails
n = heads + tails
mle = None if n == 0 else heads / n
prior_mean = alpha / (alpha + beta)
posterior_mean = post_alpha / (post_alpha + post_beta)
print("MLE:", "undefined" if mle is None else round(mle, 3))
print("prior mean:", round(prior_mean, 3))
print("posterior mean:", round(posterior_mean, 3))
print("posterior:", f"Beta({post_alpha:.1f}, {post_beta:.1f})")
# Grid approximation to show prior * likelihood -> posterior shape.
grid = np.linspace(0.01, 0.99, 99)
log_prior = np.array([log_beta_pdf(theta, alpha, beta) for theta in grid])
log_likelihood = heads * np.log(grid) + tails * np.log(1 - grid)
log_unnormalized_posterior = log_prior + log_likelihood
# Normalize on the grid for inspection.
weights = np.exp(log_unnormalized_posterior - log_unnormalized_posterior.max())
weights = weights / weights.sum()
grid_mean = float(np.sum(grid * weights))
print("grid posterior mean approx:", round(grid_mean, 3))
The code mirrors the math: the prior is a density over θ, the likelihood scores the observed heads and tails for each θ, and the posterior beta parameters add the observed counts to the prior parameters.
Copy-only prompts — each action copies a page-grounded prompt to your clipboard. Nothing is sent by this site.
04
Interactive Demo
Use direct manipulation to connect the explanation to a moving system.
Live Concept Demo
Explore Bayesian Inference
The stage is code-native and interactive. Use it to test the explanation against the mechanism.
Manipulate one control and predict the visible change.
Choose what to inspect in Bayesian Inference. This shared fallback is an observation guide, not evidence of learning.
Use the sliders and presets to compare prior strength against observed data. The prior and posterior curves are densities over θ. The likelihood curve is normalized only for display so its shape can be compared on the same plot.
Try the "strong prior, little data" preset, then the "data wins" preset. The MLE only follows the observed fraction. The posterior mean moves between prior belief and data fit, and the full posterior curve shows how much uncertainty remains.
Copy-only prompts — each action copies a page-grounded prompt to your clipboard. Nothing is sent by this site.
Concept: Bayesian Inference
What is the smallest example that makes Bayesian Inference click without losing the math?
Object contextProbability
concept:probability/bayesian-inferenceBayesian Inference
What is the smallest example that makes Bayesian Inference click without losing the math?
Start with the prediction checkpoint, then compare the reveal to the mental model.
Take this moveStudy modes
Keep the object fixed; change the lens.Route back through the notebook
Carry the same object through intuition, math, code, and demo.
Bayesian inference updates a prior distribution over unknowns into a posterior by multiplying by the likelihood and normalizing.
The next edge should feel earned: use the demo prediction here before following Variational Autoencoders.
After The First Pass
Turn the concept into an inspected object.
The lower panels are one second act: keep the object fixed, inspect it visually, check source boundaries, practice transfer, then attach the research question.Mechanism Storyboard
See the idea move before the page explains it
Bayesian inference updates a prior distribution over unknowns into a posterior by multiplying by the likelihood and normalizing.

Start with the picture, metaphor, or geometric mechanism.
Before reading further, choose the kind of change Bayesian Inference should make visible.
Visual Inquiry
Make the image answer a mathematical question
Bayesian inference updates a prior distribution over unknowns into a posterior by multiplying by the likelihood and normalizing.
Which visible object should carry the first intuition?
Pick the cue that should make Bayesian Inference easier to reason about before the page gives the answer.
Source Grounding
Canonical references for the mechanism on this page.
What is the smallest example that makes Bayesian Inference click without losing the math?
concept:probability/bayesian-inferencesources: deisenroth-2020-mml, murphy-2022-probabilistic-ml
Open the closest source note before trusting the local explanation.
2 selected-object sources shown first; 2 references total.
Audit the claim boundary, then ask from the same selected object.
Grounds the probability notation and Bayes-rule prerequisites needed for the page.
Deisenroth et al. ground Bayes' rule as posterior = likelihood times prior divided by evidence and define evidence as the posterior normalizer; Murphy grounds Bayesian parameter inference...
Checks posterior updating and MLE contrast only; not approximate inference, hierarchy, asymptotics, posterior predictive decisions, or universal prior-strength advice. Code/demo are beta-...
Grounds Bayesian inference as posterior updating under probabilistic models.
Deisenroth et al. ground Bayes' rule as posterior = likelihood times prior divided by evidence and define evidence as the posterior normalizer; Murphy grounds Bayesian parameter inference...
Checks posterior updating and MLE contrast only; not approximate inference, hierarchy, asymptotics, posterior predictive decisions, or universal prior-strength advice. Code/demo are beta-...
Claim Review
Bayesian inference updates a prior distribution over unknowns into a posterior by multiplying by the likelihood and normalizing.
What is the smallest example that makes Bayesian Inference click without losing the math?
concept:probability/bayesian-inferencesources: deisenroth-2020-mml, murphy-2022-probabilistic-ml
Treat every claim as provisional until source support and a local witness agree.
1 structured claim check on this concept.
Run the prediction or practice transfer before asking for a grounded review.
Publisher-side editorial review is not independent replication. Claims without it still need exact source-support review. 2 references and 3 local witnesses are available for inspection.
Deisenroth et al. ground Bayes' rule as posterior = likelihood times prior divided by evidence and define evidence as the posterior normalizer; Murphy grounds Bayesian parameter inference as updating p(theta...
Checks posterior updating and MLE contrast only; not approximate inference, hierarchy, asymptotics, posterior predictive decisions, or universal prior-strength advice. Code/demo are beta-Bernoulli witnesses;...
MML supports Bayes-rule notation with prior, likelihood, evidence, and posterior labels, defines evidence/marginal likelihood as the normalizer, and notes that the full posterior retains more information than focusing on a maximum/statistic. Murphy directly supports parameter-level Bayesian updating as p(theta|D) proportional to p(theta)p(D|theta) normalized by p(D), contrasts this with MLE as a single likelihood-maximizing parameter estimate, and gives the beta-Bernoulli/binomial posterior update used by the page.
Reviewer: codex+oracle; reviewed 2026-05-07Practice notebook
Use the idea, then test it somewhere new
Bayesian inference updates a prior distribution over unknowns into a posterior by multiplying by the likelihood and normalizing.
What is the smallest example that makes Bayesian Inference click without losing the math?
concept:probability/bayesian-inferencesources: deisenroth-2020-mml, murphy-2022-probabilistic-ml
Use one state from Bayesian Inference to explain what changes, why it changes, and which assumption the explanation needs.
No learner move yet; no learning state is inferred.
Write first, use only the help you need, then try a new case without it.
Use one state from Bayesian Inference to explain what changes, why it changes, and which assumption the explanation needs.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
Write an attempt before asking the companion.
0 of 3 progressive hints opened.
This draft and any AI response do not establish mastery; a later unassisted case can.
- ObjectConceptBayesian Inference
- PredictBefore revealBayesian Inference prediction
- WitnessCompare codeBayesian Inference code witness 1
- RoomAsk groundedChecking local snapshot
Research Room
Attach the question to an exact object
Pick the concept, equation, source, code witness, claim, misconception, or demo state before asking for help. The handoff stays grounded to that object.Open the draft below to save one note and next action in this browser.
Bayesian Inference
What is the smallest example that makes Bayesian Inference click without losing the math?
These are fixed, deterministic perspectives derived from the selected object. They do not represent people, community contributions, or independent review.
Source ids deisenroth-2020-mml, murphy-2022-probabilistic-ml must support the exact object, not just the surrounding topic.
Treat this as a mechanism object: connect the definition to one equation, code witness, or demo before broadening the discussion.
Ask the learner to perturb one representation, then check whether the same invariant survives in math, code, and demo.
The learner can state the mechanism in their own words
Local action draftNo local draft saved yetExpand only when ready to capture one local next action
This draft stays locally in this browser for concept:probability/bayesian-inference.
- Source ids to inspect: deisenroth-2020-mml, murphy-2022-probabilistic-ml
- Definition, prerequisite, and contrast concept links
- The equation or code witness that makes the concept operational
- One demo state that shows the invariant instead of a slogan
- The learner can state the mechanism in their own words
- The learner can name the prerequisite that would repair confusion
- The learner can predict how the mechanism changes under one perturbation
I am working in Continuous Function's research reading room. Object: concept - Bayesian Inference Object key: concept:probability/bayesian-inference Context: Probability Anchor id: concept/concept-notebook/probability/bayesian-inference Open question: What is the smallest example that makes Bayesian Inference click without losing the math? Evidence to inspect: - Source ids to inspect: deisenroth-2020-mml, murphy-2022-probabilistic-ml - Definition, prerequisite, and contrast concept links - The equation or code witness that makes the concept operational - One demo state that shows the invariant instead of a slogan Deterministic role lenses for this object: - Boundary: fixed perspectives, not people, community contributions, or independent review - Source-checking summary: Treat this as a mechanism object: connect the definition to one equation, code witness, or demo before broadening the discussion. - Proposed experiment: Ask the learner to perturb one representation, then check whether the same invariant survives in math, code, and demo. - Teach/transfer move: Turn the mechanism into one sentence that predicts a neighboring concept. - Assumptions: - Source ids deisenroth-2020-mml, murphy-2022-probabilistic-ml must support the exact object, not just the surrounding topic. - The stable content-object key lets local drafts, prompts, and route memory attach without changing the source page. - The concept explanation is local atlas prose until checked against its math, code, and source support. - Prerequisite gaps should become a repair route, not a reason to leave the object vague. - Role-lens requests: - Learner: ask for "Ask what would make "Bayesian Inference" feel predictable rather than familiar." | assumption: Source ids deisenroth-2020-mml, murphy-2022-probabilistic-ml must support the exact object, not just the surrounding topic. | next action: The learner can state the mechanism in their own words - Researcher: ask for "Source ids to inspect: deisenroth-2020-mml, murphy-2022-probabilistic-ml" | assumption: The stable content-object key lets local drafts, prompts, and route memory attach without changing the source page. | next action: The learner can name the prerequisite that would repair confusion - Experimenter: ask for "Choose one variable or condition to perturb before asking for an explanation." | assumption: The concept explanation is local atlas prose until checked against its math, code, and source support. | next action: The learner can predict how the mechanism changes under one perturbation - Professor: ask for "Find the smallest transferable rule a learner could reuse without the AI." | assumption: Prerequisite gaps should become a repair route, not a reason to leave the object vague. | next action: Teach or transfer: Turn the mechanism into one sentence that predicts a neighboring concept. What would resolve this: - The learner can state the mechanism in their own words - The learner can name the prerequisite that would repair confusion - The learner can predict how the mechanism changes under one perturbation Answer as a careful research tutor: stay source-grounded, separate verified evidence from assumptions, name the relevant math objects, and end with one next action. Current deterministic role lens for this object: - Role lens: Learner - Evidence request: Ask what would make "Bayesian Inference" feel predictable rather than familiar. - Assumption to keep visible: Source ids deisenroth-2020-mml, murphy-2022-probabilistic-ml must support the exact object, not just the surrounding topic. - Proposed experiment: Ask the learner to perturb one representation, then check whether the same invariant survives in math, code, and demo. - Next action: The learner can state the mechanism in their own words
concept/concept-notebook/probability/bayesian-inference
concept:probability/bayesian-inference