Minimum Sum of Squared Distances

Geometry Level 2

Given a set of n n points { v i } \{ \mathbf{v}_i \} in R 3 \mathbb{R}^3 space, define

v = 1 n i = 1 n v i \overline{ \mathbf{v} } = \dfrac{1}{n} \displaystyle \sum_{i= 1}^{n} \mathbf{v}_i

as the algebraic average of all the points. Then this point minimizes the sum of the squared distances from a point x \mathbf{x} to each of the given points. That is

f ( x ) = i = 1 n ( x v i ) T ( x v i ) f(\mathbf{x}) = \displaystyle \sum_{i=1}^{n} (\mathbf{x} - \mathbf{v}_i)^T (\mathbf{x} - \mathbf{v}_i)

is minimum at x = v \mathbf{x} = \overline{ \mathbf{v} }

True False

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Let's prove that the minimum is at x = v \mathbf{x} = \overline{\mathbf{v}} .

Let { e 1 ^ , e 2 ^ , , e m ^ } \{\hat{e_1}, \hat{e_2}, \ldots, \hat{e_m}\} be the canonical basis for R m \mathbb{R}^m . Then x = j = 1 m x j e j ^ \mathbf{x}=\displaystyle \sum_{j=1}^{m} x_j \hat{e_j} and v i = j = 1 m v i , j e j ^ \mathbf{v}_i=\displaystyle \sum_{j=1}^{m} v_{i,j} \hat{e_j} .

We have: f ( x ) = i = 1 n ( x v i ) ( x v i ) = n x x 2 x v i + v i v i = n j = 1 m x j 2 2 i = 1 n j = 1 m x j v i , j + i = 1 n j = 1 m v i , j 2 \begin{aligned} f(\mathbf{x}) &= \sum_{i=1}^{n} (\mathbf{x} - \mathbf{v}_i) \cdot (\mathbf{x} - \mathbf{v}_i) \\ &= n \mathbf{x} \cdot \mathbf{x} - 2\mathbf{x} \cdot \mathbf{v}_i + \mathbf{v}_i \cdot \mathbf{v}_i \\ &= n \sum_{j=1}^{m} x_j^2 - 2\sum_{i=1}^{n} \sum_{j=1}^{m} x_j v_{i,j} + \sum_{i=1}^{n} \sum_{j=1}^{m} v_{i,j}^2 \end{aligned} Take the partial derivative with respect to x k x_k and set it equal to zero, where 1 k m 1 \leq k \leq m : f x k = 2 n x k 2 i = 1 n v i , k = 0 x k = 1 n i = 1 n v i , k \begin{aligned} \dfrac{\partial f}{\partial x_k} &= 2n x_k - 2\sum_{i=1}^{n} v_{i,k} = 0 \\ \implies x_k &= \dfrac{1}{n} \sum_{i=1}^{n} v_{i,k} \end{aligned} Finally, the point that will minimize f ( x ) f(\mathbf{x}) will be: v = j = 1 m x j e j ^ = j = 1 m ( 1 n i = 1 n v i , j ) e j ^ = 1 n i = 1 n j = 1 m v i , j e j ^ = 1 n i = 1 n v i \begin{aligned} \overline{\mathbf{v}} &= \sum_{j=1}^{m} x_j \hat{e_j} \\ &= \sum_{j=1}^{m} \left( \dfrac{1}{n} \sum_{i=1}^{n} v_{i,j} \right) \hat{e_j} \\ &= \dfrac{1}{n} \sum_{i=1}^{n} \sum_{j=1}^{m} v_{i,j} \hat{e_j} \\ &= \dfrac{1}{n} \sum_{i=1}^{n} \mathbf{v}_i \end{aligned}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...