numpy.linalg.lstsq()
numpy.linalg.lstsq
-
numpy.linalg.lstsq(a, b, rcond=-1)
[source] -
Return the least-squares solution to a linear matrix equation.
Solves the equation
a x = b
by computing a vectorx
that minimizes the Euclidean 2-norm|| b - a x ||^2
. The equation may be under-, well-, or over- determined (i.e., the number of linearly independent rows ofa
can be less than, equal to, or greater than its number of linearly independent columns). Ifa
is square and of full rank, thenx
(but for round-off error) is the “exact” solution of the equation.登录查看完整内容