Actuarial Statistics · Credibility theory: Bayesian and empirical Bayes credibility premiums
Bayesian Estimation and Posterior Distributions Explained
Updated 11 October 2026 · Fact-checked
A posterior distribution is your updated belief about a parameter after seeing data. Find it by multiplying the prior by the likelihood and normalising, usually by spotting a known distribution. The Bayes estimate depends on the loss function: posterior mean for squared error loss, posterior median for absolute error loss, posterior mode for all-or-nothing loss.
Understand Bayesian Estimation and Posterior Distributions
In Bayesian statistics the parameter θ is treated as a random variable. Before you see data, you describe your belief about θ with a prior distribution, with density π(θ). The prior can come from past experience, a portfolio of similar risks, or expert judgement.
Then you collect data x. The likelihood f(x | θ) tells you how probable the data are for each value of θ. Bayes' theorem combines the two. The result is the posterior distribution of θ given x. It is your prior belief, reshaped by the data.
In practice you rarely compute the denominator. The posterior is proportional to prior × likelihood, as a function of θ. You drop every factor that does not contain θ. Then you look at what is left and recognise a standard distribution. This works because of conjugate priors: the prior and posterior belong to the same family, such as Gamma prior with Poisson data, or Beta prior with binomial data.
The posterior is a full distribution, but you often need a single number. A loss function L(θ̂, θ) measures the cost of estimating θ by θ̂. The Bayes estimate is the value that minimises the expected loss under the posterior. Squared error loss gives the posterior mean. Absolute error loss gives the posterior median. All-or-nothing (0-1) loss gives the posterior mode.
For conjugate pairs the posterior mean is a weighted average of the prior mean and the data mean. This is the link to credibility theory, which is why this topic sits in the credibility chapter.
Key rules to remember
- Bayes' theorem for parameters
- π(θ | x) = f(x | θ) π(θ) ÷ ∫ f(x | θ) π(θ) dθ
- For a discrete θ, replace the integral with a sum. The denominator does not depend on θ.
- Proportionality form
- π(θ | x) ∝ f(x | θ) × π(θ)
- Drop any factor without θ, then identify the distribution.
- Likelihood for a random sample
- f(x | θ) = Π f(xᵢ | θ), i = 1 to n
- Assumes the observations are independent given θ.
- Squared error loss
- L(θ̂, θ) = (θ̂ − θ)² → θ̂ = E[θ | x]
- The Bayes estimate is the posterior mean.
- Absolute error loss
- L(θ̂, θ) = |θ̂ − θ| → θ̂ = median of π(θ | x)
- Solve F(θ̂ | x) = 0.5 using the posterior distribution function.
- All-or-nothing loss
- θ̂ = mode of π(θ | x)
- For a 0-1 loss on a continuous θ, this is the limiting case; the mode is the Bayes estimate.
- Poisson data, Gamma prior
- Xᵢ | λ ~ Poisson(λ), λ ~ Gamma(α, β) → λ | x ~ Gamma(α + Σxᵢ, β + n)
- Here β is the rate, so the prior density is ∝ λ^(α−1) e^(−βλ) and the mean is α ÷ β.
- Binomial data, Beta prior
- Xᵢ | θ ~ Bin(m, θ), θ ~ Beta(a, b) → θ | x ~ Beta(a + Σxᵢ, b + nm − Σxᵢ)
- Beta mean is a ÷ (a + b). Beta mode is (a − 1) ÷ (a + b − 2) when a, b > 1.
- Exponential data, Gamma prior
- Xᵢ | λ ~ Exp(λ), λ ~ Gamma(α, β) → λ | x ~ Gamma(α + n, β + Σxᵢ)
- Here λ is the rate of the exponential.
- Normal mean, known variance
- Xᵢ | μ ~ N(μ, σ²), μ ~ N(μ₀, σ₀²) → 1 ÷ σ₁² = 1 ÷ σ₀² + n ÷ σ², μ₁ = σ₁² (μ₀ ÷ σ₀² + n x̄ ÷ σ²)
- Posterior is normal. Mean and median and mode all equal μ₁.
- Credibility form of the posterior mean (Poisson-Gamma)
- E[λ | x] = Z x̄ + (1 − Z) (α ÷ β), Z = n ÷ (n + β)
- Shows the estimate as a weighted average of data mean and prior mean.
How to solve Bayesian Estimation and Posterior Distributions questions
Use this method for any question that asks for a posterior distribution or a Bayes estimate.
- 1Write down the model: the distribution of the data given θ, and the prior for θ. Note whether a Gamma uses rate or scale.
- 2Write the likelihood for the whole sample as a product over observations. Keep only the terms that contain θ.
- 3Multiply by the prior density, again keeping only terms in θ. Combine powers and exponents.
- 4Recognise the standard distribution and read off its parameters. If it is not recognisable, integrate to find the normalising constant.
- 5Check the parameters against the conjugate result in your formula list. They should agree.
- 6Identify the loss function in the question. Squared error means the mean, absolute error means the median, all-or-nothing means the mode.
- 7Calculate the required estimate from the posterior. Give the number with units or context, and state the assumptions you used.
Quickest way: Conjugate update shortcut
When to use it: Use when the data and prior form a standard conjugate pair and the question asks for the posterior or its mean.
- Name the pair: Poisson-Gamma, Binomial-Beta, Exponential-Gamma or Normal-Normal.
- Add the data to the prior parameters using the update rule: for Poisson-Gamma, α + Σx and β + n.
- Compute the posterior mean from the new parameters, such as α' ÷ β'.
- Check with the credibility form: the answer should lie between the prior mean and the sample mean.
- If the question asks for a median or a variance, switch to the posterior distribution and use tables, a formula or the question's data.
Common mistakes in Bayesian Estimation and Posterior Distributions
Mixing up rate and scale in the Gamma distribution.
Some sources write Gamma(α, λ) with a rate, others use a scale parameter. The exam may use either.
Fix: Write the density ∝ λ^(α−1) e^(−βλ) beside your working. The mean is α ÷ β for a rate β. Check the question's definition before you update.
Using the wrong number of failures in the Beta update.
Students add n instead of nm − Σx to the second Beta parameter.
Fix: The second parameter increases by the number of failures. For n Bernoulli trials with s successes it is b + n − s.
Always giving the posterior mean as the Bayes estimate.
Squared error loss is the most common case, so students stop reading the loss function.
Fix: Underline the loss function in the question. Absolute error gives the median. All-or-nothing gives the mode.
Keeping constants and ruining the recognition step.
Students carry factors without θ and forget what to do with them.
Fix: Drop everything without θ. Identify the distribution from its kernel. The normalising constant then follows automatically.
Confusing the posterior of θ with the predictive distribution of a new observation.
Both are found after seeing data, and both involve the prior.
Fix: The posterior describes the parameter. For a new observation Y you need E[Y | x] = E[E(Y | θ) | x] or a similar mixture, not just the posterior itself.
Using only the latest data and ignoring the sample size in the likelihood.
Students write one observation's density rather than the product over all n.
Fix: Write the full-sample likelihood first. Σ in the exponent and n in the rate both come from it.
Worked examples
Example 1
The number of claims per year on a policy is Poisson with mean λ. The prior for λ is Gamma with α = 3 and rate β = 2. Over five years the claim counts are 2, 0, 3, 1 and 4. Find the posterior distribution of λ and the Bayes estimate under squared error loss.
Show the solution
- The data are Poisson, the prior is Gamma with a rate parameter, so the pair is conjugate.
- The likelihood is ∝ λ^(Σx) e^(−nλ). Here Σx = 2 + 0 + 3 + 1 + 4 = 10 and n = 5, so it is ∝ λ^10 e^(−5λ).
- The prior is ∝ λ^(3−1) e^(−2λ) = λ² e^(−2λ).
- The posterior is ∝ λ^(10+2) e^(−(5+2)λ) = λ^12 e^(−7λ). This is the kernel of Gamma(13, 7).
- Under squared error loss the Bayes estimate is the posterior mean = 13 ÷ 7 = 1.857.
- Check by credibility: Z = 5 ÷ (5 + 2) = 5/7, sample mean = 2, prior mean = 3 ÷ 2 = 1.5. Then (5/7)(2) + (2/7)(1.5) = 10/7 + 3/7 = 13/7 ✓.
Answer: λ | x ~ Gamma(13, 7). The Bayes estimate under squared error loss is 13/7 ≈ 1.857 claims per year.
Example 2
The probability θ that a loan defaults has a Beta(2, 8) prior. In a sample of 10 loans, 3 default. Assuming loans default independently given θ, find the posterior distribution, the Bayes estimate under squared error loss, the Bayes estimate under all-or-nothing loss, and the posterior variance.
Show the solution
- Treat the 10 loans as Bernoulli trials. The likelihood is ∝ θ³ (1 − θ)⁷.
- The prior is ∝ θ^(2−1) (1 − θ)^(8−1) = θ (1 − θ)⁷.
- The posterior is ∝ θ^(3+1) (1 − θ)^(7+7) = θ⁴ (1 − θ)^14. This is Beta(5, 15). Check with the rule: a + s = 2 + 3 = 5, b + n − s = 8 + 7 = 15 ✓.
- Squared error loss: posterior mean = 5 ÷ (5 + 15) = 5/20 = 0.25.
- All-or-nothing loss: posterior mode = (5 − 1) ÷ (5 + 15 − 2) = 4/18 = 0.2222.
- Posterior variance = ab ÷ [(a + b)² (a + b + 1)] = (5 × 15) ÷ (20² × 21) = 75 ÷ 8,400 = 0.00893.
Answer: θ | x ~ Beta(5, 15). The estimate under squared error loss is 0.25, under all-or-nothing loss it is 2/9 ≈ 0.222, and the posterior variance is about 0.00893.
Exam tips
- Read the loss function first. Many marks are lost by giving the mean when the question wants the median or the mode.
- State the parametrisation of the Gamma you use. Write 'rate β, mean α ÷ β' in your answer so the marker can follow your update.
- In written answers show the proportionality step: prior × likelihood, drop constants, identify the kernel. Marks are given for the method as well as the final distribution.
- For MCQs, do the conjugate update mentally and then check that the posterior mean lies between the prior mean and the data mean. This catches most slips.
- If the question asks for a median and the posterior is not a standard table distribution, expect a setup in which you solve F(θ̂) = 0.5 directly, for example with an exponential or simple power-form posterior.
Practice questions from Credibility theory: Bayesian and empirical Bayes credibility premiums
- Given θ, claim amounts X are Normal(θ, variance 400). The prior for θ is Normal(mean 1000, variance 100). One observation x = 1100 is made. …
- A policyholder's claim amount X in a year has conditional mean μ(θ) and variance σ²(θ). Across risks, E[σ²(θ)] = 400 and Var[μ(θ)] = 100. Th…
- In the Bühlmann-Straub model, the variance of the claim ratio X_ij given θ_i is s²(θ_i)/m_ij. What does this assumption imply?
- In Bühlmann credibility, which change would increase the credibility factor Z for a given risk?
- Which statement about the Bayesian credibility premium under squared error loss is correct?
Bayesian Estimation and Posterior Distributions: frequently asked questions
How do I find a posterior distribution from a prior and likelihood?
Multiply the likelihood of the data by the prior density, as functions of the parameter. Drop any factor that does not contain the parameter. Recognise the remaining kernel as a known distribution and read off its parameters.
Which Bayes estimate goes with which loss function?
Squared error loss gives the posterior mean. Absolute error loss gives the posterior median. All-or-nothing loss gives the posterior mode. Each is the value that minimises the expected loss under the posterior.
What is a conjugate prior?
A conjugate prior is a prior for which the posterior is in the same family. For example a Gamma prior with Poisson data gives a Gamma posterior, and a Beta prior with binomial data gives a Beta posterior. It makes the update a simple change of parameters.
How is the posterior mean related to credibility?
For standard conjugate pairs the posterior mean can be written as Z × (sample mean) + (1 − Z) × (prior mean). Z rises with the amount of data. This is the Bayesian credibility premium idea.