Normal Distribution Theory and Practical Limitations
Statistics & ExperimentsModel answerLast updated
Explain the mathematical properties of normal distributions and diagnose why they fail for real sensor data with heavy tails and multiple regimes.
Context
You're working with a team that monitors continuous sensor measurements from industrial equipment. A colleague has implemented anomaly detection by fitting a normal distribution N(μ, σ²) to sensor readings and flagging any measurement outside the μ ± 3σ range as anomalous.
In production, this approach produces many false positives during normal operational changes and fails to catch genuine critical failures. You need to evaluate the statistical assumptions underlying this model and propose improvements.
Part 1: Core Properties of Normal Distributions
Probability Density: Write the PDF for a normal random variable X ~ N(μ, σ²). Show how the transformation Z = (X - μ)/σ produces a standard normal N(0,1) distribution, and explain the mathematical basis for the 68-95-99.7 empirical rule.
Linear Transformations: Demonstrate why Y = aX + b (where X is normally distributed) is also normally distributed. What are the mean and variance of Y?
Central Limit Theorem: State the classical CLT and its requirements. Address this common confusion: does the CLT imply that collecting more data makes the original measurements themselves normally distributed?
Part 2: Detecting Violations of Normality
List three specific ways that industrial sensor data typically violates normal distribution assumptions. For each violation, explain the practical consequence for anomaly detection.
Describe the statistical tools and visualizations you would use to quantify how far the data deviates from normality.
Part 3: Better Modeling Approaches
Heavy-tailed data: When sensor readings exhibit more extreme values than a normal distribution predicts, explain why this causes the μ ± 3σ approach to underestimate risk. What alternative distributions handle heavy tails better?
Multiple operating modes: When equipment operates in distinct states (startup, normal operation, shutdown), explain how a single normal distribution fails and what modeling approaches can handle this structure.
Hints
Hint 1
The moment generating function provides an elegant way to prove closure under linear transformations
Hint 2
Q-Q plots reveal tail behavior more clearly than histograms, while formal tests like Anderson-Darling weight the tails appropriately
Hint 3
Student's t-distribution and Generalized Extreme Value distributions both model tail events more realistically than the normal distribution
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
Model Answer
Part 1: Mathematical Foundations
Density and Standardization
The probability density function for X ~ N(μ, σ²) is:
f(x) = (1/(σ√(2π))) exp(-(x-μ)²/(2σ²))
To derive the standardized form, let Z = (X - μ)/σ. Using the transformation formula with the inverse x = μ + σz and Jacobian |dx/dz| = σ:
f_Z(z) = f_X(μ + σz) · σ = (1/√(2π)) exp(-z²/2)
This is the standard normal density N(0,1). Any probability involving X reduces to the standard normal CDF Φ:
P(μ - kσ < X < μ + kσ) = P(-k < Z < k) = Φ(k) - Φ(-k) = 2Φ(k) - 1
Computing numerically: 2Φ(1) - 1 ≈ 0.683, 2Φ(2) - 1 ≈ 0.954, and 2Φ(3) - 1 ≈ 0.997, giving the 68-95-99.7 rule. This holds universally because standardization removes both location and scale parameters.
Closure Under Affine Transformations
The moment generating function of X is M_X(t) = exp(μt + σ²t²/2). For Y = aX + b:
M_Y(t) = E[exp(t(aX + b))] = exp(bt) · E[exp(atX)] = exp(bt) · M_X(at)
= exp(bt + aμt + a²σ²t²/2) = exp((aμ + b)t + (a²σ²)t²/2)
This is the MGF of N(aμ + b, a²σ²). Since MGFs uniquely identify distributions, Y ~ N(aμ + b, a²σ²).
This property extends to weighted sums of independent normals, making the normal family closed under linear operations.
Central Limit Theorem
Statement: Let X₁, X₂, ..., Xₙ be independent, identically distributed random variables with mean μ and finite variance σ². Then:
(X̄ₙ - μ)/(σ/√n) →^d N(0,1) as n → ∞
Requirements:
- Independence (can be relaxed to weak dependence)
- Identical distribution (can be relaxed via Lindeberg conditions)
- Finite variance (essential; infinite-variance distributions converge to stable laws instead)
Critical misconception: The CLT applies to statistics computed from data (like sample means), not to the raw observations themselves. Collecting a million sensor readings doesn't make those readings normally distributed—they retain whatever distribution generated them. Only aggregated statistics like averages become approximately normal.
Additionally, convergence is slowest in the tails where anomaly detection operates, limiting the CLT's practical relevance for extreme-value problems.
Part 2: Failure Modes and Diagnostics
Three Key Violations
1. Bounded support and skewness Physical measurements like vibration amplitude are strictly non-negative, often right-skewed. The normal distribution extends to -∞, making μ - 3σ meaningless when it falls below zero. This wastes half the probability budget and miscalibrates thresholds.
2. Heavy tails (excess kurtosis) Equipment failures produce extreme values far more often than the normal distribution predicts. The Gaussian tail decays exponentially (∝ exp(-x²)), while real sensor data often has polynomial decay. This causes the model to severely underestimate the probability of catastrophic events.
3. Multiple operating regimes Equipment in different states (idle, transitioning, peak load) generates distinct distributions. Pooling them creates an artificial single distribution with inflated variance. Legitimate readings during state transitions then appear anomalous because they fall in the low-density region between modes, causing false alarms.
Statistical Diagnostics
Visual methods:
- Q-Q plot: Plot sample quantiles against theoretical normal quantiles. S-shaped curvature indicates heavy tails; one-sided curvature indicates skewness
- Histogram with overlaid normal density: Reveals multimodality and asymmetry
- Empirical CDF comparison: Shows cumulative probability deviations
Quantitative metrics:
- Sample skewness (should be ~0 for normal data)
- Excess kurtosis (should be ~0 for normal; positive indicates heavy tails)
- Jarque-Bera test: Combines skewness and kurtosis into a single test statistic
Formal hypothesis tests:
- Shapiro-Wilk: Most powerful general normality test
- Anderson-Darling: Emphasizes tail fit, crucial for anomaly detection
- Kolmogorov-Smirnov: Tests overall distribution fit but weak in tails
Important caveat: With large datasets, all tests will reject normality for trivial deviations. Focus on effect sizes (how much kurtosis, how curved the Q-Q plot) and whether deviations materially affect detection performance, not just p-values.
Part 3: Robust Alternatives
Heavy-Tailed Distributions
Why Gaussians underestimate tail risk: The Gaussian tail probability P(|Z| > 5) ≈ 6×10⁻⁷ suggests extreme events are essentially impossible. A Student's t-distribution with ν=3 degrees of freedom (scaled to unit variance) gives P(|T| > 5) ≈ 3×10⁻³—roughly 5000 times more likely.
When calibrated on bulk data, the Gaussian treats rare catastrophic events as negligibly probable, exactly when they matter most.
Student's t-distribution: Parameterized by location μ, scale σ, and degrees of freedom ν. As ν→∞ it converges to normal; small ν (say 3-5) captures heavy tails. Fit via maximum likelihood. The polynomial tail decay |x|^(-(ν+1)) better matches real failure modes.
Extreme Value Theory: Models tail behavior directly rather than extrapolating from the bulk.
- Generalized Extreme Value (GEV): Fit to block maxima (e.g., daily maximum per sensor). Shape parameter ξ>0 gives the heavy-tailed Fréchet family. Derive thresholds from return levels like "1-in-100-days" events
- Generalized Pareto Distribution: Fits exceedances above a high threshold, using data more efficiently than block maxima
Multiple Operating Modes
Gaussian Mixture Model (GMM): Model the density as a weighted sum of K normal components:
p(x) = Σ(k=1 to K) π_k · N(x | μ_k, σ_k²)
Fit using the Expectation-Maximization algorithm. Select K via Bayesian Information Criterion. Anomaly scoring uses -log p(x) or component-wise Mahalanobis distance.
Better yet, condition on known operating state: model p(sensor | state) separately for each regime. This eliminates false alarms during transitions.
Kernel Density Estimation (KDE): Nonparametric approach estimating density as:
f̂(x) = (1/(nh)) Σ(i=1 to n) K((x - x_i)/h)
where K is a kernel function (typically Gaussian) and h is bandwidth chosen by cross-validation. Handles arbitrary shapes without assuming parametric form.
Practical hybrid approach: Use GMM or KDE for the bulk distribution, spliced with a GPD tail above a high quantile (e.g., 95th percentile). This combines flexible modeling in the center with principled extreme-value theory in the tails where detection matters most.
Common Mistakes
- Relying on CLT to justify normality of raw sensor readings
- Using KS test with estimated parameters without Lilliefors correction
- Ignoring autocorrelation in time-series sensor data
- Fitting distributions to contaminated data (outliers inflate σ̂, masking future anomalies)
- Over-interpreting p-values in massive datasets where everything is "significant"