Hi!

If you have points $\displaystyle \overline{x}_1,\ ...\ ,\ \overline{x}_n$ in $\displaystyle \Bbb{R}^d$, how can you find the "best fitting" hyperplane $\displaystyle \pi$ so that $\displaystyle \sum_{k=1}^n d\left(\pi,\ \overline{x}_k\right)^2$ gets as small as possible?

$\displaystyle d\left(\pi,\ \overline{x}_k\right)$ is the distance from the hyperplane $\displaystyle \pi$ to the k:th point. If the equation of $\displaystyle \pi$ is $\displaystyle \overline{a}\cdot\overline{x} = b$, where $\displaystyle \overline{a}$ is the normal of the hyperplane, then the distance is defined as

$\displaystyle d\left(\pi,\ \overline{x}\right)\ =\ \frac{\left|\overline{a}\cdot\overline{x} - b\right|}{\left|\overline{a}\right|}$