Minimize the sum of squares of a set of equations.
x = arg min(sum(func(y)**2,axis=0))
y
Parameters :  func : callable
x0 : ndarray
args : tuple
Dfun : callable
full_output : bool
col_deriv : bool
ftol : float
xtol : float
gtol : float
maxfev : int
epsfcn : float
factor : float
diag : sequence


Returns :  x : ndarray
cov_x : ndarray
infodict : dict
mesg : str
ier : int

Notes
“leastsq” is a wrapper around MINPACK’s lmdif and lmder algorithms.
cov_x is a Jacobian approximation to the Hessian of the least squares objective function. This approximation assumes that the objective function is based on the difference between some observed target data (ydata) and a (nonlinear) function of the parameters f(xdata, params)
func(params) = ydata  f(xdata, params)
so that the objective function is
min sum((ydata  f(xdata, params))**2, axis=0)
params