Bayesian statistics is a branch of statistics, built on Bayes' theorem, in which probability expresses a degree of belief that is updated as new data arrives. The belief can come from past experiments or from expert judgement.
This page is for analysts, data scientists and decision makers who want a clear grounding in the Bayesian approach. It covers the core terms, how updating works, how it differs from frequentist statistics, where it is used and where it struggles, how it relates to AI agents, and what to do first.
What is Bayesian statistics?
Wikipedia describes Bayesian statistics as an approach where probability expresses a degree of belief in an event. Bayesian methods use Bayes' theorem to revise probabilities as new data arrives, and they assign probability distributions to parameters.
Data Basecamp gives the formula as P(A|B) = P(B|A) · P(A) / P(B), and defines the posterior as the updated probability of A once B has occurred.
What are the prior, likelihood and posterior?
| Term | Meaning | Role |
| Prior | What you believe about a proposition before the new evidence | Starting point, which can encode earlier knowledge |
| Likelihood | The probability of the observed evidence if the proposition is true | Measures how well the evidence supports it |
| Posterior | The probability of the proposition after the evidence is taken into account | The updated belief, which becomes the next prior |
| Normalising probability | The overall probability of the data | Scales the result so probabilities sum to one |
Wikipedia summarises the core idea as the posterior being proportional to the prior multiplied by the likelihood.
How does Bayesian updating work?
In the coin example from Data Basecamp, a fair-coin prior of 50 per cent moved to about 50.6 per cent after six heads in ten tosses, so the data did not strongly suggest an unfair coin. The prior holds until the evidence is strong enough to move it.
Because the posterior can become the prior for the next batch of data, the model can be updated continuously rather than rebuilt.
How does Bayesian statistics differ from frequentist statistics?
| Question | Bayesian | Frequentist |
| What is probability? | A degree of belief | The long-run relative frequency of an event |
| Parameters | Given probability distributions | Treated as fixed, so given no probabilities |
| Prior knowledge | Enters formally through the prior | Not part of the model |
| Output | A posterior distribution | Estimates and tests based on repeated sampling |
The first two rows follow Wikipedia. Neither approach is simply better, and the choice depends on how much prior knowledge you have and how you need to express uncertainty.
Where is Bayesian statistics used, and what are its limits?
Data Basecamp lists medicine (combining earlier studies with new test data), machine learning (Naive Bayes classifiers for spam detection and text classification), economics (updating risk estimates) and the natural sciences. Its advantages include supplementing limited data with prior knowledge and modelling uncertainty directly.
The same page names two limits. Priors often come from expert judgement and can be subjective, which can shape results strongly. And the posterior often cannot be computed directly, so methods such as Markov chain Monte Carlo approximate it, which Wikipedia notes helped Bayesian methods gain prominence, though Data Basecamp adds they can be slow on large or high-dimensional problems.
How does Bayesian statistics relate to AI agents?
An agent that acts under uncertainty needs a way to update what it believes as evidence arrives, and the prior to posterior cycle is a standard way to describe that. Analytics that feed such decisions depend on well-governed data. For XenonStack's Context OS, see ElixirData.
What should you do first?
- State the question as a proposition you can assign a probability to.
- Write down your prior and where it comes from.
- Define the likelihood for the evidence you will collect.
- Update with the data and compare the posterior with the prior.
- Test how sensitive the result is to a different prior.
To map one decision your agents make, and the data and policy it depends on, book a Context Workshop. See what happens in the workshop.
Frequently asked questions
What is Bayesian statistics in simple terms?
It is a way of doing statistics in which probability expresses a degree of belief, and Bayes' theorem is used to update that belief as new data arrives.
What are the prior and posterior in Bayesian statistics?
The prior is what you believe before considering new evidence. The posterior is the updated probability after the evidence has been taken into account.
How is Bayesian different from frequentist statistics?
Frequentists treat probability as the long-run relative frequency of an event and treat parameters as fixed. Bayesian inference assigns probability distributions to parameters.
What is Markov chain Monte Carlo used for?
It is a computational algorithm that approximates the posterior distribution when it cannot be computed directly, without computing the evidence term exactly.
What are the limits of Bayesian statistics?
Priors can be subjective and can strongly shape results, and approximating the posterior can be slow and resource-intensive for large or high-dimensional models.