Bayesian Statistics Introduction
Bayesian Statistics
This section introduces Bayesian statistics, contrasting it with the frequentist approach, and covers the core concepts of priors, posteriors, and conjugate priors through examples.
Frequentist vs. Bayesian Statistics
In frequentist statistics, the paradigm used throughout most of this course, the data is assumed to be generated randomly from a distribution indexed by an unknown but fixed parameter θ. The goal is to estimate or test hypotheses about this fixed parameter using tools from probability, such as assuming the data are i.i.d. or follow a specific parametric model (e.g., Gaussian, Bernoulli). The parameter is considered a constant, and uncertainty is expressed through confidence intervals or p-values.
In Bayesian statistics, the parameter is treated as a random variable. The data generation involves a two-layer process:
A prior distribution π(θ) captures the analyst's belief about the parameter before seeing any data.
Conditional on θ, the data X1,…,Xn are drawn from a distribution pn(X1,…,Xn∣θ) — the same likelihood used in frequentist inference.
This framework allows one to incorporate prior knowledge into the analysis systematically. As more data is collected, the influence of the prior diminishes. The goal is to update the prior into a posterior distribution π(θ∣X1,…,Xn) using Bayes’ rule. This posterior summarizes all information about θ after observing the data.
Key takeaway: In Bayesian inference, parameters are random; in frequentist inference, they are fixed but unknown.
Example: Bernoulli Model with a Beta Prior
Consider estimating p, the proportion of women in a population. Data X1,…,Xn are i.i.d. Bernoulli(p) with p∈[0,1]. The analyst has a prior belief that p is close to 0.5 but not exactly. This belief can be encoded using a Beta distribution, which is a convenient family of distributions supported on [0,1].
Beta distribution: X∼Beta(a,b) has density
where a>0 and b>0 are shape parameters. The normalizing constant involves the Beta function. When a=b, the distribution is symmetric about 0.5; larger a gives sharper concentration around the mean.
Prior specification
Let the prior for p be Beta(a,a) (symmetric around 0.5). The density is
Likelihood
The joint density (likelihood) of the data given p is
Posterior via Bayes’ rule
The posterior is proportional to likelihood times prior:
This is again a Beta distribution with parameters
Thus the Beta distribution is a conjugate prior for the Bernoulli likelihood: the posterior is in the same family as the prior. Conjugacy simplifies computation because updating only requires adjusting the parameters — essentially, the number of successes (∑Xi) and failures (n−∑Xi) are added to the prior parameters.
Key takeaway: For Bernoulli data, a Beta prior yields a Beta posterior. The posterior parameters are the prior parameters plus the observed counts.
Bayes’ Rule and the Posterior
Formally, for any model with parameter θ and data X=(X1,…,Xn), the posterior distribution is
where:
pn(X∣θ) is the likelihood.
π(θ) is the prior density.
The denominator is the marginal likelihood (or evidence), a normalizing constant that does not depend on θ.
In practice, one often works with the unnormalized posterior:
This product of likelihood and prior is the key object. The maximum of this function is called the maximum a posteriori (MAP) estimate. However, the full posterior distribution contains more information, such as spread (uncertainty) and shape.
Non-informative and Improper Priors
When no prior knowledge is available, one may use a non-informative prior that does not favor any value of θ over others. For a parameter on a bounded space (e.g., [0,1] for p), a uniform prior π(p)=1 (or constant) is natural.
However, for an unbounded parameter space (e.g., the real line), a uniform density over R is not a valid probability density because it does not integrate to a finite number. Such a prior is called an improper prior. It can still be used in Bayes’ rule if the resulting posterior is proper (integrates to one). This is common with location parameters.
Example: Bernoulli with uniform prior
If π(p)=1 on [0,1], then the posterior becomes
which is Beta(∑Xi+1,n−∑Xi+1). This “adds one” to each count, automatically avoiding degenerate estimates when all observations are zero or one. The posterior mean is (∑Xi+1)/(n+2), slightly shrunk toward 1/2 compared to the sample mean Xˉ.
Example: Gaussian with unknown mean
Let X1,…,Xn∣θ∼N(θ,1) (known variance). Using an improper uniform prior π(θ)∝1 on R, the posterior becomes
Completing the square yields:
so the posterior is N(Xˉ,1/n). The posterior mean is the sample mean, and the variance decreases as 1/n.
If a conjugate Gaussian prior θ∼N(μ,1) is used, the posterior is also Gaussian with mean that is a weighted average of the prior mean μ and the sample mean Xˉ, essentially treating the prior as one extra observation.
Jeffrey’s Priors
Jeffrey’s priors provide a systematic way to define non-informative priors that are invariant under reparameterization. They are defined as
where I(θ) is the Fisher information matrix.
This prior places more weight on parameter values that carry more information (higher Fisher information). For example:
Bernoulli: I(p)=p(1−p)1, so π(p)∝p(1−p)1, which puts more mass near 0 and 1.
Gaussian mean (variance known): I(θ)=1, so π(θ)∝1, matching the improper uniform prior.
A key property is invariance under one-to-one reparameterization: if ϕ=g(θ) is a smooth reparameterization, then the Jeffrey’s prior for ϕ is also proportional to detI(ϕ), ensuring consistent inference regardless of how the model is parameterized.
Next Steps: Bayesian Estimation and Confidence Regions
In the full lecture, the discussion continues with using the posterior for point estimation (e.g., posterior mean) and Bayesian credible regions (the Bayesian analog of confidence intervals). The central idea is to integrate against the posterior to produce summaries. These methods are explored further in subsequent recordings.

Ask anything
We've read this whole study set, so questions about it get the best answers.