Revision 04bbc417cf2927b827660bc07743429783569aec authored by HwB on 10 February 2013, 00:00:00 UTC, committed by Gabor Csardi on 10 February 2013, 00:00:00 UTC
1 parent 0e3ae6b
Raw File
rortho.Rd
\name{rortho}
\alias{rortho}
\title{
  Generate Random Orthogogonal Matrix
}
\description{
  Generates random orthogonal matrix of size \code{n}.

  Will be needed in applications that explore high-dimensional data spaces,
  for example optimization procedures or Monte Carlo methods.
}
\usage{
rortho(n)
}
\arguments{
  \item{n}{positive integer.}
}
\details{
  Uses the idea of the Stewart 1980, ``The Efficient Generation of Random 
  Orthogonal Matrices with an Application to Condition Estimators'', to apply 
  the Householder transformation to a uniformly distributed random vector.
}
\value{
  Orthogonal matrix \code{Q} of size \code{n}, that is \code{Q \%*\% t(Q)}
  is the unit matrix of size \code{n}.
}
\examples{
Q <- rortho(5)
zapsmall(Q \%*\% t(Q))
zapsmall(t(Q) \%*\% Q)
}
\keyword{ math }
back to top