Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. import numpy as np
  2.  
  3. def procrustes(X, Y):
  4. X = X - X.mean(axis=0)
  5. Y = Y - Y.mean(axis=0)
  6. (U, S, Vt) = np.linalg.svd(np.dot(Y.T,X))
  7. R = np.dot(U, Vt)
  8. Y = np.array(np.matrix(Y) * np.matrix(R))
  9. return X, Y
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement