https://github.com/cran/pracma
Tip revision: b5e4bf28fcba9f5eaffbeecfb0bc307452d074ee authored by Hans W. Borchers on 01 November 2014, 00:00:00 UTC
version 1.7.7
version 1.7.7
Tip revision: b5e4bf2
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 }