Maximum Likelihood Estimation and Conditional Gaussian Distributions
Statistics & ExperimentsModel answerLast updated
Derive maximum likelihood estimators for Gaussian parameters under various constraints, compute conditional distributions in bivariate Gaussians, and analyze estimator bias.
You have n independent observations X₁, X₂, …, Xₙ drawn from a Gaussian distribution with mean μ and variance σ². Separately, you have a single observation (X, Y) from a bivariate Gaussian distribution with means μₓ and μᵧ, variances σ²ₓ and σ²ᵧ, and correlation coefficient ρ.
Complete the following tasks, providing full derivations:
Part A: Write down the probability density function and cumulative distribution function for a Gaussian random variable with mean μ and variance σ². Using these, express the probability P(μ − σ ≤ X₁ ≤ μ + σ) using the standard Gaussian CDF Φ(z).
Part B: Find the maximum likelihood estimators for μ and σ² in three scenarios:
- (i) When σ² is a known constant
- (ii) When both μ and σ² are unknown parameters
- (iii) When μ is constrained to be non-negative (μ ≥ 0). Provide the closed-form solution and explain the boundary behavior when the unconstrained estimate would be negative.
Part C: For the bivariate Gaussian pair (X, Y), derive the conditional distribution X | Y = y. Specifically:
- Find the conditional mean and conditional variance
- Write the conditional PDF and CDF
- Express P(X > t | Y = y) in terms of Φ
Part D: Determine whether the standard MLE for σ² is an unbiased estimator. If it is biased, construct an unbiased estimator and express its relationship to the MLE.
Show all algebraic steps and verify that your solutions represent true maxima where applicable.
Hints
Hint 1
For the constrained MLE, consider when the unconstrained optimum lies inside versus outside the feasible region
Hint 2
The conditional Gaussian can be derived by recognizing that Z = X − βY for an appropriate β creates independence with Y
Hint 3
Use the decomposition Σ(xᵢ − μ)² = Σ(xᵢ − x̄)² + n(x̄ − μ)² to analyze bias
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
Solution: Maximum Likelihood Estimation and Conditional Gaussian Distributions
This problem tests foundational statistical inference: likelihood optimization, handling constraints via Karush-Kuhn-Tucker conditions, properties of the bivariate Gaussian, and understanding estimator bias versus consistency.
Part A: Density, Distribution, and One-Standard-Deviation Probability
The probability density function for a Gaussian with mean μ and variance σ² is:
$$f(x; \mu, \sigma^2) = \frac{1}{\sqrt{2\pi\sigma^2}} \exp\left(-\frac{(x-\mu)^2}{2\sigma^2}\right)$$
The cumulative distribution function cannot be expressed in elementary functions. By standardizing with the transformation z = (x − μ)/σ, we get:
$$F(x; \mu, \sigma^2) = P(X \le x) = \Phi\left(\frac{x - \mu}{\sigma}\right)$$
where Φ denotes the standard Gaussian CDF: Φ(z) = ∫₋∞^z (1/√(2π)) exp(−u²/2) du.
For the interval [μ − σ, μ + σ]:
$$P(\mu - \sigma \le X_1 \le \mu + \sigma) = \Phi\left(\frac{\mu+\sigma-\mu}{\sigma}\right) - \Phi\left(\frac{\mu-\sigma-\mu}{\sigma}\right) = \Phi(1) - \Phi(-1)$$
Using symmetry of the standard Gaussian (Φ(−1) = 1 − Φ(1)):
$$P(\mu - \sigma \le X_1 \le \mu + \sigma) = 2\Phi(1) - 1 \approx 0.683$$
This is the well-known 68% rule for Gaussian distributions.
Part B: Maximum Likelihood Estimation
The log-likelihood for n independent observations is:
$$\ell(\mu, \sigma^2) = -\frac{n}{2}\ln(2\pi) - \frac{n}{2}\ln(\sigma^2) - \frac{1}{2\sigma^2}\sum_{i=1}^n (x_i - \mu)^2$$
A key algebraic identity simplifies all three cases. Denoting x̄ = (1/n)Σxᵢ:
$$\sum_{i=1}^n (x_i - \mu)^2 = \sum_{i=1}^n (x_i - \bar{x})^2 + n(\bar{x} - \mu)^2$$
This holds because the cross-term vanishes: 2(x̄ − μ)Σ(xᵢ − x̄) = 2(x̄ − μ) · 0 = 0.
(i) Known variance σ²
Only the term involving μ affects the likelihood. Taking the derivative:
$$\frac{\partial \ell}{\partial \mu} = \frac{1}{\sigma^2}\sum_{i=1}^n (x_i - \mu) = 0$$
This yields μ̂ = x̄. The second derivative ∂²ℓ/∂μ² = −n/σ² is negative, confirming this is a maximum.
(ii) Both parameters unknown
The first-order condition with respect to μ is identical to case (i), yielding μ̂ = x̄. For σ², letting τ = σ²:
$$\frac{\partial \ell}{\partial \tau} = -\frac{n}{2\tau} + \frac{1}{2\tau^2}\sum_{i=1}^n (x_i - \mu)^2 = 0$$
Solving and substituting μ̂ = x̄:
$$\hat{\sigma}^2 = \frac{1}{n}\sum_{i=1}^n (x_i - \bar{x})^2$$
To verify this is a maximum, compute the Hessian at (x̄, σ̂²):
- ∂²ℓ/∂μ² = −n/σ̂² < 0
- ∂²ℓ/∂τ² = n/(2σ̂⁴) − (1/σ̂⁶)·nσ̂² = −n/(2σ̂⁴) < 0
- ∂²ℓ/(∂μ∂τ) = −Σ(xᵢ − x̄)/σ̂⁴ = 0
The Hessian is diagonal with negative entries, hence negative definite. The critical point is the unique global maximum.
(iii) Constrained case: μ ≥ 0
Using the decomposition, for any fixed σ², the log-likelihood as a function of μ is:
$$\ell(\mu, \sigma^2) = C(\sigma^2) - \frac{n(\bar{x} - \mu)^2}{2\sigma^2}$$
This is a concave parabola in μ with maximum at x̄. We must maximize over [0, ∞):
- If x̄ ≥ 0: The unconstrained maximum is feasible, so μ̂ = x̄
- If x̄ < 0: The parabola is strictly decreasing on [0, ∞), so the maximum occurs at the boundary: μ̂ = 0
Therefore: μ̂ = max(x̄, 0)
When x̄ < 0, the constraint is active. The Karush-Kuhn-Tucker conditions are satisfied with a positive multiplier λ = n|x̄|/σ².
For σ², substitute μ̂ into the variance equation:
$$\hat{\sigma}^2 = \frac{1}{n}\sum_{i=1}^n (x_i - \hat{\mu})^2 = \begin{cases} \frac{1}{n}\sum (x_i - \bar{x})^2 & \text{if } \bar{x} \ge 0 \ \frac{1}{n}\sum x_i^2 & \text{if } \bar{x} < 0 \end{cases}$$
When x̄ < 0, note that Σxᵢ² = Σ(xᵢ − x̄)² + nx̄², so the constrained variance estimate is larger by exactly nx̄², reflecting the additional misfit from forcing the mean away from the data center.
Part C: Conditional Distribution
For a bivariate Gaussian, we derive X | Y = y using the independence-through-uncorrelation property. Define:
$$\beta = \rho\frac{\sigma_X}{\sigma_Y}, \quad Z = X - \beta Y$$
Then:
$$\text{Cov}(Z, Y) = \text{Cov}(X, Y) - \beta\text{Var}(Y) = \rho\sigma_X\sigma_Y - \rho\frac{\sigma_X}{\sigma_Y}\cdot\sigma_Y^2 = 0$$
Since (Z, Y) is jointly Gaussian (as a linear transform of (X, Y)) and uncorrelated, Z and Y are independent. Therefore:
$$X | Y = y \sim N(m(y), s^2)$$
where:
- Conditional mean: m(y) = μₓ + ρ(σₓ/σᵧ)(y − μᵧ)
- Conditional variance: s² = σ²ₓ(1 − ρ²)
The conditional variance calculation: Var(Z) = Var(X) + β²Var(Y) − 2βCov(X,Y) = σ²ₓ + ρ²σ²ₓ − 2ρ²σ²ₓ = σ²ₓ(1 − ρ²).
The conditional PDF and CDF are:
$$f_{X|Y}(x | y) = \frac{1}{\sqrt{2\pi}\sigma_X\sqrt{1-\rho^2}} \exp\left(-\frac{(x - m(y))^2}{2\sigma_X^2(1-\rho^2)}\right)$$
$$F_{X|Y}(x | y) = \Phi\left(\frac{x - m(y)}{\sigma_X\sqrt{1-\rho^2}}\right)$$
For the tail probability:
$$P(X > t | Y = y) = 1 - \Phi\left(\frac{t - m(y)}{\sigma_X\sqrt{1-\rho^2}}\right) = \Phi\left(\frac{m(y) - t}{\sigma_X\sqrt{1-\rho^2}}\right)$$
Key observations:
- The conditional mean is linear in y (the population regression line)
- The conditional variance is constant, independent of y
- When |ρ| = 1, the conditional distribution degenerates to a point mass at m(y)
Part D: Bias Analysis
Take expectations in the decomposition identity:
$$E\left[\sum_{i=1}^n (X_i - \mu)^2\right] = E\left[\sum_{i=1}^n (X_i - \bar{X})^2\right] + E[n(\bar{X} - \mu)^2]$$
The left side equals nσ². Since Var(X̄) = σ²/n, the second term on the right equals σ². Therefore:
$$E\left[\sum_{i=1}^n (X_i - \bar{X})^2\right] = (n-1)\sigma^2$$
This gives:
$$E[\hat{\sigma}^2_{\text{MLE}}] = \frac{n-1}{n}\sigma^2$$
The MLE is biased downward with bias −σ²/n. The bias arises because x̄ is estimated from the same data, consuming one degree of freedom.
An unbiased estimator is:
$$S^2 = \frac{1}{n-1}\sum_{i=1}^n (X_i - \bar{X})^2 = \frac{n}{n-1}\hat{\sigma}^2_{\text{MLE}}$$
This is the sample variance. You can verify unbiasedness independently: (n−1)S²/σ² follows a χ²ₙ₋₁ distribution with mean n−1.
Important notes:
- The MLE is biased but consistent: the bias vanishes as n → ∞
- Unbiasedness does not imply optimality. The MLE actually has lower mean squared error than S² for finite n
- In Part B(i) where μ is known, the estimator (1/n)Σ(Xᵢ − μ)² is already unbiased
Common Pitfalls
- Forgetting to verify second-order conditions or check concavity
- In the constrained case, reporting μ̂ = x̄ regardless of sign, or failing to update σ̂² when the constraint binds
- Confusing σ²ₓ(1 − ρ) with the correct σ²ₓ(1 − ρ²) for conditional variance
- Conflating bias with inconsistency or incorrectness
- Writing S instead of S² when discussing unbiased estimation of σ² (note: S is biased for σ by Jensen's inequality)