Two robot position residuals can have the same length in meters yet look very different when compared with a directional uncertainty model. A covariance matrix describes that directional structure. Its diagonal entries alone do not reveal the orientation of the corresponding ellipse.

The original two-dimensional example below follows a hypothetical position-error model in a fixed Cartesian frame. It separates geometric distance, principal-axis spread, and covariance-normalized distance. No real robot trajectory, calibrated confidence region, or observed localization performance is claimed.

Begin with a complete covariance matrix

Let x and y be position-error coordinates measured in meters, centered on their assumed mean. Choose the invented covariance matrix Sigma = [[0.025, 0.015], [0.015, 0.025]], in square meters. The equal diagonal entries give equal coordinate standard deviations: sqrt(0.025), approximately 0.1581 meter.

Looking only at those two equal numbers might suggest a circular picture. The nonzero off-diagonal entries change that picture. The correlation is 0.015 divided by sqrt(0.025 × 0.025), or 0.6. Positive x and y errors tend to vary together under this covariance description.

The matrix is symmetric and has positive eigenvalues, making it positive definite. Those properties allow an inverse and a closed ellipse for a positive covariance-normalized distance. A matrix with invalid negative variances would not provide the same interpretation merely because its entries can be put into software.

Find the directions in which the spread separates

NumPy's eigh documentation describes the eigenvalues and eigenvectors of a real symmetric matrix. Its returned eigenvectors are normalized columns paired with the corresponding eigenvalues. We can obtain the following particular result directly by multiplying the invented matrix by the proposed directions; no library execution is being reported.

The unit direction e_major = (1, 1)/sqrt(2) has eigenvalue 0.040 square meter. The perpendicular direction e_minor = (-1, 1)/sqrt(2) has eigenvalue 0.010 square meter. The square roots are principal-axis standard deviations of 0.20 and 0.10 meter.

Thus the larger spread lies along a line rotated 45 degrees from the x axis. Equal x and y coordinate spreads coexist with unequal principal-axis spreads. Covariance's off-diagonal terms carry the information that makes these statements consistent.

Write the ellipse in its own coordinates

For a residual r = (x, y), define u = (x + y)/sqrt(2) along the major direction and v = (-x + y)/sqrt(2) along the minor direction. The contour u²/0.040 + v²/0.010 = 1 has semiaxes 0.20 and 0.10 meter in those rotated coordinates.

One major-axis endpoint is approximately (0.1414, 0.1414) meter in the original frame. A minor-axis endpoint is approximately (-0.07071, 0.07071) meter. Neither coordinate standard deviation by itself gives either endpoint. An axis-aligned box built from the diagonals would describe a different shape.

The contour value one has deliberately been stated as a geometric level. A covariance matrix alone does not establish what fraction of actual errors lies inside that contour. A probability label requires a distributional model and evidence supporting its use. Calling this contour a 95-percent region without that additional reasoning would add an unsupported claim.

Equal physical lengths, different normalized lengths

SciPy defines Mahalanobis distance using an inverse covariance and the residual between vectors. For column-vector notation here, write d² = r_transpose Sigma_inverse r. This is dimensionless when the residual and covariance use compatible units.

The inverse of our matrix is [[62.5, -37.5], [-37.5, 62.5]], in inverse square meters. Take residual A = (0.10, 0.10) meter and residual B = (0.10, -0.10) meter. Both have Euclidean length sqrt(0.02), approximately 0.1414 meter.

For A, d² = 0.5 and d is approximately 0.7071. For B, d² = 2 and d is approximately 1.4142. The first residual follows the direction of greater modeled spread; the second follows the direction of smaller modeled spread. Their normalized distances differ by a factor of two even though their physical lengths are equal.

Removing correlation changes the comparison

Suppose someone discards the off-diagonal entries and substitutes Sigma_diagonal = [[0.025, 0], [0, 0.025]]. This new model produces d² = 0.8 for both residuals. It has erased the distinction between the two directions rather than simply changing the display style.

That calculation does not show which covariance is empirically correct. It shows that ignoring correlation changes the metric being applied. A meaningful record needs to preserve the full matrix, its frame, and the quantities it describes so that later comparisons use the intended model.

Changing units should preserve the normalized result

Convert all positions from meters to centimeters. Residual coordinates become one hundred times larger, while covariance entries become ten thousand times larger. The inverse covariance entries become ten thousand times smaller. Those factors cancel in the quadratic form, leaving the same dimensionless d².

Converting only the residual while keeping the original covariance would instead multiply d² by ten thousand. A plausible-looking scalar can therefore conceal a unit mismatch. The matrix's square units are essential metadata, not an optional annotation.

A singular covariance introduces a different limitation: its ordinary inverse does not exist. Replacing it with another operation changes what directions are penalized and requires a separate interpretation. Likewise, a covariance learned from unrepresentative data can produce a mathematically consistent ellipse that poorly describes current errors.

The example's value is the connection between matrix, axes, and metric. Covariance describes a directional second-moment model; eigenvectors reveal its axes; inverse-covariance distance scales residuals relative to that model. None of those steps alone validates the underlying position estimate.

Sources checked October 23, 2026

NumPy, numpy.linalg.eigh, documentation displayed as v2.5:

https://numpy.org/doc/stable/reference/generated/numpy.linalg.eigh.html

SciPy, scipy.spatial.distance.mahalanobis, documentation displayed as v1.18.0:

https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.distance.mahalanobis.html

All matrices, residuals, and numerical comparisons are original hypothetical calculations. No documentation example arrays or executed library output are reproduced.

Illustration note: The accompanying mobile-robot scene is a generic concept illustration. It does not show measured localization errors, a validated covariance ellipse, or a field accuracy test.