eigenstrapping.rotations.rotate_matrix

eigenstrapping.rotations.rotate_matrix(M, method='indirect', seed=None)[source]

Rotate an (n/m)-by-n matrix of arbitrary length n by the two methods as outlined in [1].

Parameters:
  • M (2D np.ndarray) – Input matrix

  • method (str, optional) – Which method to use. Refers to the nomenclature in [1], where ‘indirect’ refers to the Householder QR decomposition method [2], while ‘direct’ refers to the method of selecting random points on the unit n-sphere directly as in [3]. The default is ‘indirect’.

Returns:

X_rotated – DESCRIPTION.

Return type:

TYPE

References

[1] Blaser R, Fryzlewicz P. Random Rotation Ensembles. Journal of

Machine Learning Research. 2016;17(4):1-26.

[2] Householder A. S. Unitary triangularization of a nonsymmetric

matrix. Journal of the ACM, 5:339–342, 1958.

[3] Knuth D. E. Art of computer programming, volume 2:

seminumerical algorithms. Addison-Wesley Professional, Reading, Mass, 3 edition edition, November 1997.