AI Glossary / Statistics and probability / Intermediate
Geometric median
Definition
The geometric median of a collection of points is a point that minimizes the sum of Euclidean distances to them. It extends the one-dimensional median to multiple dimensions by considering whole vectors rather than taking a separate median in each coordinate. It is often used as a robust center, because a minority of distant observations cannot pull it arbitrarily far from a fixed majority of reliable observations.
What it means
The arithmetic mean minimizes squared Euclidean distances, which give especially large influence to very distant points. The geometric median minimizes distances without squaring them. This different objective can make it a useful alternative when extreme observations would distort an average.
It is distinct from both the geometric mean of positive numbers and the coordinate-wise median of vectors. Those operations solve different problems. Unlike a medoid, the geometric median need not be one of the observed points.
Robustness does not make it universally preferable. If Euclidean distance is inappropriate, variables have incompatible scales, or several meaningful groups are present, a single geometric median may still be a poor summary of the data.
How it works
For vectors x1, …, xn, minimize F(z) = Σ||z − x_i||₂ over candidate locations z. A weighted version uses nonnegative observation weights. The objective is convex, although the minimizer need not always be unique; collinear configurations can produce multiple solutions.
Away from observed points, a stationary solution balances the unit vectors pointing toward the observations. A common iterative approach, Weiszfeld’s algorithm, repeatedly averages observations with weights inversely related to their distance from the current estimate.
The basic update needs special handling if an iterate coincides with an observation, where a distance denominator becomes zero. Use an appropriate modified algorithm and convergence checks. State how features were scaled, what weights mean, and whether the optimization is unconstrained or restricted to feasible locations.
Three practical examples
- Robust data summary: summarize multivariate measurements when a few extreme values would strongly move the arithmetic mean.
- Location planning: identify a point minimizing total straight-line distance to demand locations, while recognizing that road travel, capacity, and site constraints require a different or extended model.
- Distributed AI: aggregate compatible vector estimates using a robust center when some estimates may be unreliable, subject to assumptions about the trustworthy majority and representation.
Think of it this way
Think of choosing a meeting point that minimizes the total length of straight journeys. Each additional unit of distance counts equally in the objective. The arithmetic mean answers a different question by minimizing the sum of squared journey lengths, making very long journeys disproportionately influential.
Worked example
Use five original points: three observations at (0, 0), one at (4, 0), and one at (0, 3). At the origin, total distance is 0 + 0 + 0 + 4 + 3 = 7.
To verify optimality, consider any other point z at distance r from the origin. The three origin observations contribute 3r. By the triangle inequality, distances to the remaining points are at least 4 − r and 3 − r. Therefore total distance is at least 3r + 4 − r + 3 − r = 7 + r. Whenever r > 0, this exceeds 7, so the origin is the unique geometric median.
The arithmetic mean is (4/5, 3/5) = (0.8, 0.6). Its total distance is 3 × 1 + sqrt(10.6) + sqrt(6.4), approximately 8.785586, confirming that it does not minimize the distance sum. The arithmetic and proof were checked independently. Replacing either distant point with an even more extreme point still leaves the three coincident observations as a majority, illustrating robustness in this particular configuration.
Illustrative case study
Fictional case: Delta Sensors combines several two-dimensional calibration estimates. A few devices occasionally produce extreme readings, so the team compares their arithmetic mean with a geometric-median aggregate.
Engineers standardize the interpretation of both coordinates, inspect the individual estimates, and evaluate aggregation against a trusted reference. They also investigate why outliers occur. The geometric median reduces sensitivity in the tested setting, but the team does not assume it can correct a shared bias affecting most devices or resolve incompatible calibration conventions.
Common misconceptions and mistakes
- Confusing geometric median with geometric mean.
- Assuming coordinate-wise medians always give the geometric median; coordinate-wise absolute deviations and Euclidean distances define different objectives.
- Restricting the solution to observed points and calling it a geometric median rather than a medoid.
- Claiming robustness means every outlier is identified or every adversarial input is harmless.
- Applying ordinary Euclidean distance to incompatible units without considering scaling.
- Implementing an inverse-distance update without handling zero distances or checking convergence.
Business use
The geometric median can provide a defensible robust center when the distance metric matches the business question. It is especially useful when stakeholders can explain why minimizing total distance is more appropriate than minimizing squared distance.
Compare it with alternatives and inspect the surrounding distribution, rather than reporting the center alone. For location decisions, distinguish straight-line geometry from actual costs and constraints. For AI aggregation, verify that vectors are meaningfully comparable and that the reliability assumptions hold. A robust summary does not replace validation, uncertainty assessment, or investigation of systematic errors.
People also ask
Must the geometric median be an observed point?
No. It can lie between observations, although the worked example has its solution at an observed location.
Is it always unique?
No. Degenerate arrangements, including some collinear cases, can have more than one minimizer.
Does rotating the coordinate system change the underlying Euclidean solution?
No. The solution rotates with the data because Euclidean distances are preserved; changing coordinate scales separately is a different operation.
Check your understanding
Answer: 1.
Which center minimizes the sum of squared Euclidean distances?
Answer: The arithmetic mean. 2.
Why is the origin optimal in the worked example?
Answer: Moving distance r away increases the three origin contributions more than it can reduce the other two combined. 3.
If most inputs share the same error, does robustness guarantee truth?
Answer: No; a robust center can preserve a majority’s shared bias.
Related terms
- Median
- Medoid
- Robust statistics
- Euclidean distance
- Convex optimization
- spatial median
- Weiszfeld’s algorithm
- breakdown point
Learn next
Compare the mean, coordinate-wise median, medoid, and geometric median on the same small point cloud. Then study weighted versions, optimization at coincident points, and the effect of changing feature scales or introducing feasible-location constraints.
More in Statistics and probability
- Generated regressor - A generated regressor is an explanatory variable constructed using quantities estimated in an earlier statistical step, then used in a later model.
- Geodemographic segmentation - Geodemographic segmentation groups geographical areas according to similarities in demographic, social, economic, or household characteristics.
- Geometric data analysis - Geometric data analysis is an approach to multivariate statistics that represents data as weighted clouds of points and studies their geometry to understand...
- Geomteric mean - The geometric mean is an average obtained by multiplying positive values and taking the root corresponding to the number of values.
- German tank problem - The German tank problem is a statistical estimation problem in which an unknown population size is inferred from a sample of consecutive serial numbers.
- Gini's mean difference - Gini’s mean difference is a measure of dispersion defined as the average absolute difference between pairs of observations.
Sources
Aalto Dictionary of Machine Learning, geometric median: https://aaltodictionaryofml.github.io/ADictML_Main.pdf — objective and robustness property read.
Huynh and colleagues, “On efficient multilevel clustering via Wasserstein distances,” Appendix D: https://jmlr.org/papers/volume22/19-782/19-782.pdf — weighted objective and modified Weiszfeld handling checked. The five-point example, proof, and fictional application are original.
Previous: Geometric data analysis Next: Geometric model