finding the closest hyperplane of order $k$ in $k$ dimensional space to $N$ points

66 Views Asked by At

I have a set of $N$ points in a $k$ dimensional space, what I need to find is the closest hyperplane to those $N$ points, and I can't find a way of doing it.

The rational:

I want to write algorithm that does the following, for a set of $N$ points in $k$ dimensional space, where each point is a column in a matrix $X \in k\times N$ then I want to find the closest hyperplane to those points iteratively.

But I'm stuck in how given the $N$ points I find the hyperplane each time.

The equivalent of finding linear regression in a $2$ dimensional space.

Thanks.