I have n points in Euclidean space $\{\mathbf{a_1}, \mathbf{a_2}, ... , \mathbf{a_n}\}$. How can I find the optimal point $\mathbf{x}$ that minimizes $\sum_{i=1}^n \lVert \mathbf{x} - \mathbf{a}_i \rVert ^2$ ?
When the set has 2 points, the answer is a point that consists of just an average of coordinates of 2 points. But if there are 3 or more points in a N-dimensional space, the answer is not obvious. Certainly, I can use a fast-converging minimization method to find $\mathbf{x}$, but maybe some other approach exists?