Distance between a plane and set of points

55 Views Asked by At

Suppose $m$ data points belonging to a class represented by matrix $A$. Therefore, the size of matrix $A$ is $m\times n$. In addition, suppose $w\cdot x + b=0$ be equation of a plane in $\mathbb{R}^n$.

The aim is to find the closest plane to set of these points.

Is this equivalent to following problem? $$\min_{w,b} \frac{\Vert Aw+eb\Vert^2}{\left\Vert \begin{bmatrix}w \\b\end{bmatrix}\right\Vert^2}$$ where $e$ is a vector of ones.

2

There are 2 best solutions below

1
On

Hint: In 3-D coordinate system, the distance between a given point $(x_0, y_0, z_0)$ & the plane: $ax+by+cz+d=0$ $$=\frac{|ax_0+by_0+cz_0+d|}{\sqrt{a^2+b^2+c^2}}$$

1
On

$$||A w+eb||^2=(Aw+eb)^T(Aw+eb)=mb^2+2be^TAw+w^TA^TAw\\b=-e^TAw/m$$
The effect is that you can remove $b$ by subtracting the average vector from each row of $A$. In matrix language, let $B=A-e(e^TA/m)$ where $e$ is a column vector of $m$ ones.
Now, using Lagrange Multipliers to make sure that $w\cdot w=1$:
$$F(w)=w^TB^TBw+\lambda(1-w^Tw)\\ "dF/dw"=B^TBw-\lambda w=0\\F(w)=\lambda$$
So $w$ is an eigenvector of $B^TB$, corresponding to the smallest eigenvalue $\lambda$ of $B^TB$