File: randomOrthogonalMatrix.Rd

package info (click to toggle)
r-cran-mclust 6.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,540 kB
  • sloc: fortran: 13,298; ansic: 201; sh: 4; makefile: 2
file content (43 lines) | stat: -rw-r--r-- 1,408 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
\name{randomOrthogonalMatrix}
\alias{randomOrthogonalMatrix}

\title{Random orthogonal matrix}

\description{
Generate a random orthogonal basis matrix of dimension \eqn{(nrow x ncol)} using 
the method in Heiberger (1978).
}

\usage{
randomOrthogonalMatrix(nrow, ncol, n = nrow, d = ncol, seed = NULL)
}

\arguments{
  \item{nrow}{the number of rows of the resulting orthogonal matrix.}
  \item{ncol}{the number of columns of the resulting orthogonal matrix.}
  \item{n}{deprecated. See \code{nrow} above.}
  \item{d}{deprecated. See \code{ncol} above.}
  \item{seed}{an optional integer argument to use in \code{set.seed()} for 
              reproducibility. By default the current seed will be used.
              Reproducibility can also be achieved by calling \code{set.seed()}
              before calling this function.}
}

\details{
The use of arguments \code{n} and \code{d} is deprecated and they will be removed in the future.
}

\value{
An orthogonal matrix of dimension \eqn{nrow x ncol} such that each column is orthogonal to the other and has unit lenght. Because of the latter, it is also called orthonormal.
}

\seealso{\code{\link{coordProj}}}

\references{
Heiberger R. (1978) Generation of random orthogonal matrices. \emph{Journal of the Royal Statistical Society. Series C (Applied Statistics)}, 27(2), 199-206.
}

\examples{
B <- randomOrthogonalMatrix(10,3)
zapsmall(crossprod(B))
}