Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def svd_LeastSquares(A, b):
U, s, V = np.linalg.svd(A)
r = [0.0, 0.0]
r += (1/s[0]) * (U[:,0].T*b) * (V[:,0].T)
r += (1/s[1]) * (U[:,1].T*b) * (V[:,1].T)
return r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment