rorth | R Documentation |
A function to create a random orthogonal matrix uniformly distributed with respect to the Haar measure.
rorth(k)
k |
the desired numer of columns (=rows) of the orthogonal matrix. |
The function fills a k
xk
matrix with N(0,1) random variables and perfroms then a QR decompoistion using qr
. If the diagonal elements of R are all positive the resulting orthogonal matrix Q is uniform distributed wrt to the Haar measure. Note that the function currently does not check if
all diagonal measurements are indeed positive (however this will happen with probability 1 in theory).
An orthogonal k
times k
matrix
Klaus Nordhausen
Stewart, G.W. (1980), The efficient generation of random orthogonal matrices with an application to condition estimators, SIAM Journal on Numerical Analysis, 17, 403–409. <doi:10.1137/0717034>.
Orth <- rorth(4) crossprod(Orth) tcrossprod(Orth)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.