I have a set of points in 3D space and I know that all of these points belong to a plane. However, there is some noise present in these points, so I cannot just extract a plane directly from it. I would like to find the formula of the plane(ax+by+c*z+d=0) that best fits these points. In other words, the sum of the (squared) distances from the points to the plane should be minimized.
I am doing all this using python and numpy, but I can't seem to figure out how to exactly implement this.