Part 1: Core Theoretical Foundations
1. The Gaussian Distribution & i.i.d. Assumption
- Probability Density Function (PDF): For a continuous random variable :
- Independent and Identically Distributed (i.i.d.): If data points are i.i.d., the joint probability density factors into the product of individual marginal densities:
2. Maximum Likelihood Estimation (MLE)
- Goal: Find the parameter values that maximize the probability of having observed the data :
- Why use the Log-Likelihood ?
- Numerical Stability: Products of small probabilities cause numerical underflow; sums of logs do not.
- Mathematical Tractability: Log turns products into sums, simplifying differentiation:
- Preserves Extrema: Because the natural logarithm is a strictly monotonically increasing function (), .
3. Bayes’ Theorem and Maximum A Posteriori (MAP)
-
Bayes’ Theorem:
- : Prior (our belief about before seeing data).
- : Likelihood (how probable the data is given ).
- : Posterior (updated belief about after observing data).
- : Evidence / Marginal Likelihood (normalizing constant independent of ).
-
Maximum A Posteriori (MAP): Instead of maximizing only the likelihood, MAP chooses the parameter value that maximizes the posterior: (Note: The marginal likelihood is dropped because it does not depend on .)
-
Connection between MLE and MAP: If the prior is uniform (flat / non-informative), is constant, meaning MAP reduces exactly to MLE.
Part 2: Practice Exam Questions & Solutions
Example 1: Combining Gaussian Likelihood, Prior Knowledge, and MAP vs. MLE
Problem Statement
An automated sensor measures ambient temperature in a server room. Individual readings are assumed to be independent and drawn from a Gaussian distribution: with a known variance ().
- You collect independent readings: . Compute the Maximum Likelihood Estimate (MLE) for the mean .
- The server room manufacturer specifies that the ambient temperature typically follows a prior distribution: Derive the objective function for the Maximum A Posteriori (MAP) estimator of and find the analytical expression for .
- Calculate the numerical value of for the given data and explain how the prior influences the result compared to .
Step-by-Step Solution
Part 1: MLE Calculation
The likelihood function for i.i.d. observations is: Taking the natural logarithm: To maximize with respect to , set the derivative to zero: Given the data ():
Part 2: Analytical MAP Formulation
By Bayes’ Theorem: Taking the log-posterior objective function: Substitute the Gaussian likelihood and the Gaussian prior :
Differentiating with respect to and setting to 0:
Part 3: Numerical Computation & Comparison
Substitute the given values:
- , ,
- ,
Interpretation:
- relies solely on the observed data.
- is a precision-weighted average between the sample mean () and the prior mean ().
- Because the sensor variance per sample is ( gives effective variance ) and the prior variance is , both data and prior carry equal weight, pulling the estimate halfway toward the prior.
Example 2: Combining Gaussian Likelihoods with Bayesian Hypothesis Selection
Problem Statement
An automated inspection station classifies ball bearings into two categories based on diameter deviations (in ):
- Hypothesis (Standard Grade): Measurements follow .
- Hypothesis (Precision Grade): Measurements follow .
Prior operational data indicates that of manufactured bearings are Standard Grade (), while are Precision Grade ().
A quality engineer tests a batch by taking independent measurements:
- Write down the likelihood function for an arbitrary hypothesis with parameters .
- Calculate the likelihood of observing data under and under .
- Using Bayes’ Theorem, compute the posterior probability . Determine which hypothesis is more likely given both the prior and the data.
Step-by-Step Solution
Part 1: Likelihood Formulation
For i.i.d. Gaussian observations with mean and variance :
Compute the sum of squared deviations from the data :
Part 2: Calculating Likelihoods
-
Under (, ):
-
Under (, ):
(Notice that the data is roughly times more likely under because the deviations are tight around zero).
Part 3: Applying Bayes’ Theorem
Using Bayes’ rule: where the marginal likelihood (total probability) is:
Compute numerator and denominator terms:
Total evidence:
Posterior probability of :
Conclusion: Even though was four times more probable a priori ( vs. ), the tight clustering of the observed measurements provides strong enough evidence in favor of that the posterior probability of (Precision Grade) exceeds (), making the more likely hypothesis.
Quick Comparison Summary for the Exam
| Property | Maximum Likelihood (MLE) | Maximum A Posteriori (MAP) | Bayesian Hypothesis Testing |
|---|---|---|---|
| Formula | |||
| Uses Prior? | No | Yes | Yes |
| Output | Point estimate | Point estimate | Posterior probability distribution over discrete hypotheses |
| When to Use | When no prior belief is assumed or available | When prior distribution on continuous parameters exists | When deciding between discrete competing models |