Given a set of points in 3D, the general problem is to find the `a, b, c` coefficients of a plane equation in the form:

```
z = a*x + b*y + c

```

such that the resulting plane is the *best fit* possible to that set of points.

1. In [this SO answer](https://stackoverflow.com/a/20700063/1391441), the function [scipy.optimize.minimize](http://docs.scipy.org/doc/scipy-0.16.1/reference/generated/scipy.optimize.minimize.html) is used to solve this problem.

It relies on initial guesses for the coefficients, and minimizes an error function that sums the distances of each point to the surface of the plane.
2. In [this code](https://gist.github.com/amroamroamro/1db8d69b4b65e8bc66a6) (based on [this other SO answer](https://stackoverflow.com/a/18648210/97160)) the [scipy.linalg.lstsq](http://docs.scipy.org/doc/scipy-0.16.1/reference/generated/scipy.linalg.lstsq.html) function is used to tackle the same problem (when restricted to a 1st order polynomial).

It solves for `C` in the equation `z = A*C`, where `A` is the concatenation of the `x,y` coordinates of the set of points, `z` is the `z` coordinate of the set, and `C` are the `a,b,c` coefficients.

Unlike the code in the method above, this one does not seem to require initial guesses for the plane coefficients.

Since the `minimize` function requires an initial guess, this means that it may or may not converge to the optimal solution (depending on how good the guess is). Does the second method have a similar caveat or will it return an always exact solution?