There is a piece of code I've found in the other topic (Multilateration of GPS Coordinates), that is supposed to solve a matrix by SVD method. I was using it but now I have to be able to explain the mechanism of the code and I can't find the mathematical reason for its simplicity:
A = np.array(A)
(_,_,v) = np.linalg.svd(A)
# Get the minimizer
w = v[3,:]
w /= w[3]
Yet, it works in my case. Here's an example of one of my matrices and solutions:
Matrix A
[[ 0.01944444 -0.91680556 0.4567078 ]
[ 0. -0.93430556 0.47549222]]
Matrix v
[[-0.00927192 0.89308049 -0.44980137]
[-0.91093059 0.1779953 0.37218697]
[ 0.41245545 0.41318872 0.81188398]]
Solution:
0.508022647987 0.508925817052
The two columns on the left are the matrix A and the column on the right is the matrix b in the matrix of a form Ax = b, but the code combines them into one matrix for some reason. I know there is the least squares method but after testing it, it's not so robust and accurate when the matrix is overdetermined.