Tutorials › Multivariate Statistics (Graduate) › Diagnosing Gaussian Assumptions for Exact Mean Inference

Inference on Mean Vectors · Tutorial 202 of 975

Diagnosing Gaussian Assumptions for Exact Mean Inference

Use geometric and distance-based diagnostics to assess Gaussian assumptions, identify influential observations, and understand the limits of exact mean-inference calibration.

Intermediate 10 min read

What You'll Learn

  • Distinguish marginal, pairwise, projection, and Mahalanobis-distance diagnostics for multivariate Gaussian shape
  • Derive the chi-square distribution of a population Mahalanobis distance under Gaussian sampling
  • Explain why distances computed using the sample mean and covariance are not independent chi-square values
  • Check affine invariance and the fixed-sum identity for sample Mahalanobis distances
  • Assess how influential observations can affect both estimated covariance and exact Hotelling calibration
  • State the assumptions required for exact finite-sample inference on a mean vector

Why Gaussian Diagnostics Matter

Exact finite-sample inference for a mean vector is valuable because its calibration does not rely on a large-sample approximation. That exactness is conditional on a model: the observations must be independent and identically distributed from a multivariate Gaussian population, and the covariance matrix must be positive definite. A plot cannot establish those assumptions, but it can reveal features of the data that make them doubtful.

The relevant question is not whether every variable looks roughly bell-shaped on its own. Multivariate Gaussian shape concerns the joint distribution: its contours are elliptical, and every linear combination of the coordinates is normally distributed. A few unusual observations, curved dependence, clusters, or heavy tails can be hard to spot in separate marginal summaries. Diagnostics therefore combine views of the joint data with distance measures that account for the variables’ scales and correlations.

Plots and Mahalanobis Distances

Let \(X_1,\ldots,X_n\) be independent observations in \(\mathbb{R}^p\), with sample mean \(\bar X\) and sample covariance matrix \(S\), using divisor \(n-1\). Assume \(S\) is positive definite when calculating distances. The squared Mahalanobis distance of observation \(X_i\) from a center \(m\), using a positive-definite covariance matrix \(V\), is

$$ d^2(X_i;m,V)=(X_i-m)^\mathsf{T}V^{-1}(X_i-m). $$

Unlike ordinary Euclidean distance, Mahalanobis distance accounts for scale and correlation. A displacement along a high-variance direction contributes less than the same-sized displacement along a low-variance direction. Correlation also changes which combinations of coordinates count as unusual.

Useful diagnostic views include pairwise scatterplots, marginal normal quantile plots, and plots of projections onto selected directions. Pairwise scatterplots can show curvature, clusters, changing spread, or isolated points. Marginal quantile plots assess each coordinate separately; they can miss a non-Gaussian joint pattern. Projection plots can reveal departures along combinations of variables that are not visible in any one coordinate. No finite collection of plots checks every possible direction, so these views are evidence to interpret, not a certificate of normality.

A distance-based view compares squared distances from a center to reference quantiles of a chi-square distribution with \(p\) degrees of freedom. The reference has a direct justification when the population mean and covariance are known and the observations are Gaussian. When the center and covariance are estimated from the same data, however, the resulting distances do not have that simple reference distribution.

Definition: If \(X\sim N_p(\mu,\Sigma)\), with \(\Sigma\) positive definite, the squared population Mahalanobis distance is \(D^2=(X-\mu)^\mathsf{T}\Sigma^{-1}(X-\mu)\). Under this Gaussian model, \(D^2\) has a chi-square distribution with \(p\) degrees of freedom. This statement uses the population parameters, not estimates fitted to the same observation.
Result: For independent \(X_1,\ldots,X_n\sim N_p(\mu,\Sigma)\), where \(\Sigma\) is positive definite and \(n>p\), the one-sample Hotelling statistic \(T^2=n(\bar X-\mu_0)^\mathsf{T}S^{-1}(\bar X-\mu_0)\) has exact calibration under \(H_0:\mu=\mu_0\): \[ \frac{n-p}{p(n-1)}T^2\sim F_{p,n-p}. \] This finite-sample result requires joint multivariate normality, independence, and the stated dimension and covariance conditions. Diagnostics assess the plausibility of those conditions; they do not establish them.

Two Properties That Help Interpret Distance Diagnostics

First, population Mahalanobis distance has a simple Gaussian reference distribution. To see why, let \(\Sigma^{-1/2}\) be the symmetric inverse square root of \(\Sigma\), and define \(Z=\Sigma^{-1/2}(X-\mu)\). A linear transformation of a multivariate Gaussian vector is Gaussian, so \(Z\sim N_p(0,I_p)\). Therefore its coordinates are independent standard normal variables, and

$$ D^2=(X-\mu)^\mathsf{T}\Sigma^{-1}(X-\mu) =Z^\mathsf{T}Z=\sum_{j=1}^p Z_j^2 \sim \chi^2_p. $$

The conclusion follows from the definition of a chi-square random variable as a sum of squares of independent standard normal variables. It gives a principled reference for population distances, while also explaining why estimated distances require care.

Second, distances computed around the sample mean with the sample covariance obey an exact constraint. This is one reason they cannot be treated as independent chi-square observations.

Result: If \(S\) is positive definite, the internal squared distances \(d_i^2=(X_i-\bar X)^\mathsf{T}S^{-1}(X_i-\bar X)\) satisfy \(\sum_{i=1}^n d_i^2=p(n-1)\). In particular, their average is exactly \(p(n-1)/n\), not the mean \(p\) of a \(\chi^2_p\) distribution.

For the proof, write \(R_i=X_i-\bar X\). By the definition \(S=(n-1)^{-1}\sum_i R_iR_i^\mathsf{T}\), the sum of the distances is

$$ \begin{aligned} \sum_{i=1}^n d_i^2 &=\sum_{i=1}^n R_i^\mathsf{T}S^{-1}R_i\\ &=\operatorname{tr}\left(S^{-1}\sum_{i=1}^n R_iR_i^\mathsf{T}\right)\\ &=\operatorname{tr}\left(S^{-1}(n-1)S\right)\\ &=(n-1)\operatorname{tr}(I_p)=p(n-1). \end{aligned} $$

The trace identity in the second line follows because each scalar \(R_i^\mathsf{T}S^{-1}R_i\) equals \(\operatorname{tr}(S^{-1}R_iR_i^\mathsf{T})\). The final equality uses that \(I_p\) has \(p\) diagonal entries equal to one. Since all the distances are computed using the same fitted mean and covariance, they are also dependent. A chi-square quantile plot of these internal distances can be a useful shape diagnostic, but its reference line is not an exact independent-sample calibration.

Worked Examples

Worked Example: Calculating Internal Distances

Consider six bivariate observations: \((-1,0),(1,0),(0,-1),(0,1),(0,0),(4,0)\). Calculate their internal squared Mahalanobis distances and identify what the calculation can and cannot establish.

The sample mean is \(\bar X=(2/3,0)^\mathsf{T}\). The coordinate sums of squared deviations are \(46/3\) for the first coordinate and \(2\) for the second; the cross-product sum is zero. With divisor \(n-1=5\),

$$ S= \begin{pmatrix} 46/15&0\\ 0&2/5 \end{pmatrix}, \qquad S^{-1}= \begin{pmatrix} 15/46&0\\ 0&5/2 \end{pmatrix}. $$

For \((-1,0)\), the centered vector is \((-5/3,0)\), so its squared distance is \((25/9)(15/46)=125/138\). For \((1,0)\), it is \((1/3,0)\), giving \(5/138\). For either \((0,-1)\) or \((0,1)\), the squared distance is \((4/9)(15/46)+5/2=10/69+5/2=2.6449\), to four decimal places. For \((0,0)\), it is \(10/69\). For \((4,0)\), it is \((100/9)(15/46)=250/69\), approximately \(3.6232\).

The observation \((4,0)\) has the largest internal distance, so it deserves inspection in the scatterplot and in the context of data collection. The distances sum to \(10\), which equals \(p(n-1)=2(5)\), as required. The largest distance is not, by itself, proof of a Gaussian-model violation: these are fitted, dependent distances, and the sample is very small.

Worked Example: Using the Population Chi-Square Reference

Suppose \(X\sim N_2(\mu,\Sigma)\), where \(\mu=(1,2)^\mathsf{T}\) and \(\Sigma=\operatorname{diag}(4,1)\). For the observation \(x=(3,4)^\mathsf{T}\), calculate its population squared Mahalanobis distance.

The displacement is \(x-\mu=(2,2)^\mathsf{T}\), and \(\Sigma^{-1}=\operatorname{diag}(1/4,1)\). Hence

$$ d^2(x;\mu,\Sigma) =(2,2) \begin{pmatrix}1/4&0\\0&1\end{pmatrix} \begin{pmatrix}2\\2\end{pmatrix} =\frac{2^2}{4}+2^2=5. $$

Under the specified Gaussian model, a randomly drawn observation’s squared population distance follows \(\chi^2_2\). The 95th percentile of \(\chi^2_2\) is approximately \(5.991\), so the value \(5\) is below that reference threshold. This comparison has its stated interpretation because the center and covariance in the calculation are population parameters. Substituting estimates from a small sample and applying the same threshold would not yield this exact interpretation.

Worked Example: Recognizing a Discrete Departure from Gaussian Sampling

Let each observation \(X_i=(Z_i,W_i)^\mathsf{T}\), where \(Z_i\) and \(W_i\) are independent and each equals \(-1\) or \(1\) with probability \(1/2\). The observations are independent across \(i\). Both coordinates have mean zero and variance one, so the population covariance is \(I_2\), but the joint distribution is discrete rather than Gaussian.

For \(n=5\), either coordinate’s sample mean can only take values \(-1,-0.6,-0.2,0.2,0.6,1\). Consequently, the vector sample mean has finite support; it cannot have the continuous Gaussian distribution required under the multivariate normal sampling model. Pairwise scatterplots also show only four possible points, though a small sample might not display all four.

If the sample covariance is nonsingular, one can calculate a Hotelling statistic, but the exact \(F\) calibration stated above is not justified by the Gaussian theorem. In fact, on samples with nonsingular covariance the statistic also has only finitely many possible values, whereas an \(F\) distribution is continuous. The issue is not that every non-Gaussian model must produce a badly calibrated test in every setting; it is that the claimed exact finite-sample calibration is tied to its assumptions.

Influential Observations and Affine Invariance

An observation can be unusual relative to the rest of the data and can also influence the diagnostics used to judge it. A distant point may pull the sample mean toward itself and enlarge the sample covariance in its direction. Those changes can reduce its own internal distance, a phenomenon often called masking. Conversely, a point may make other observations look more unusual by changing the fitted center or shape.

A practical check is to compare the full-data analysis with one in which a flagged observation is omitted. Recompute the mean, covariance, pairwise plots, and distances using the remaining observations. A large change is evidence that the observation is influential for these summaries. It is not a reason to delete the point automatically: first check for recording or measurement errors, then decide whether the observation belongs to the population and model being studied. Leave-one-out distances are diagnostics, not automatically calibrated hypothesis tests.

The geometry of Mahalanobis distance also clarifies why changes of measurement units should not alter the diagnostic. If \(Y_i=AX_i+b\), where \(A\) is an invertible \(p\times p\) matrix and \(b\) is fixed, then \(\bar Y=A\bar X+b\) and \(S_Y=AS_XA^\mathsf{T}\). Since \(S_Y^{-1}=(A^\mathsf{T})^{-1}S_X^{-1}A^{-1}\), substitution gives

$$ (Y_i-\bar Y)^\mathsf{T}S_Y^{-1}(Y_i-\bar Y) =(X_i-\bar X)^\mathsf{T}S_X^{-1}(X_i-\bar X). $$

Thus internal Mahalanobis distances are invariant under invertible changes of coordinates, including changes of units and rotations. This does not make them immune to influential observations: the equality compares transformed versions of the same data, not different data sets with and without a point.

Implications for Exact Mean Inference

The diagnostics matter because the exact reference distribution for a mean test depends on the joint sampling model, not merely on how well a test statistic can be calculated. A nonsingular sample covariance makes the usual statistic computable; it does not establish Gaussianity. Nor does a tidy pairwise scatterplot prove that all linear combinations are normal. With small samples, departures such as skewness, heavy tails, mixtures, and influential observations can be difficult to diagnose reliably.

Use several views and interpret them together. Look for curved or clustered patterns in pairwise plots, unusual marginal quantile plots, and systematic departures in distance-based views. Investigate observations that strongly affect the mean or covariance. If diagnostics raise concern, state that concern when interpreting exact finite-sample \(p\)-values or confidence regions; consider whether the model is scientifically defensible and whether a suitable alternative analysis is needed. A diagnostic is most useful as a prompt for model scrutiny, not as a mechanical pass/fail gate.

Common Mistake

  • Wrong reasoning: “The sample Mahalanobis distances can be compared with independent \(\chi^2_p\) values, and the points inside the 95th percentile prove that the exact mean test is valid.”
  • Correction: The chi-square result applies to distances from the true population mean using the true covariance under Gaussian sampling. Internal distances use estimates from the same data, are dependent, and have a fixed sum. Even reassuring diagnostics cannot prove joint normality or guarantee exact calibration; the finite-sample theorem requires its assumptions.
Key takeaway: Multivariate plots and Mahalanobis distances help reveal non-Gaussian shape and influential observations. Their role is diagnostic: exact finite-sample mean inference still rests on independent multivariate Gaussian observations and a positive-definite covariance matrix.

Check Your Understanding

Answer these questions using the definitions and results above.

  1. Why does the squared population Mahalanobis distance have a \(\chi^2_p\) distribution under a multivariate Gaussian model?
  2. Why can internal sample Mahalanobis distances not be treated as independent \(\chi^2_p\) observations?
  3. What does it mean for an observation to mask itself in a distance diagnostic, and how can a leave-one-out comparison help?
  4. Which sampling assumptions are needed for the stated exact \(F\) calibration of the one-sample Hotelling statistic?
  5. Why can reassuring marginal plots fail to establish joint multivariate Gaussianity?
Clinical Biostats