I solved a linear equation system with np.linalg.lstsq() but I could not define a boolean which returns TRUE if the solution of the system is unique. Thank you in advance!
Asked
Active
Viewed 271 times
0
-
Please show the code that you have worked on. – anisoleanime Apr 11 '21 at 09:49
-
There will be a unique solution if the matrix is non-singular. Perhaps you should check the eigenvalues or the determinant? – NNN Apr 11 '21 at 09:55
1 Answers
0
Looking at https://numpy.org/doc/stable/reference/generated/numpy.linalg.lstsq.html my reading is that the solution is always unique, because they are using the SVD, and if the matrix A is rank deficient, it returns the minimiser x that is itself of minimal norm, and this vector is unique.
However the routine also returns the rank of the matrix A, and iff this is less than the number of columns of A there will be many x's that minimise |A*x-b|, so in this sense the solution is not unique iff the returned rank is less than the number of columns.

dmuir
- 4,211
- 2
- 14
- 12