genQ: Generate random orthonormal matrix

Description Usage Arguments Value Examples

View source: R/bootstrap_functions.R

Description

genQ generates a square matrix of random normal noise, and then takes the QR decomposition to return Q, a random orthogonal square matrix.

Usage

1
genQ(n, lim_attempts = 200)

Arguments

n

the dimension of the desired random orthonormal matrix

lim_attempts

the random matrix of normal noise must be full rank to generate the appropriate QR decomposition. lim_attempts gives the maximum number of attempts for generating a full rank matrix of normal noise.

Value

a random orthonormal (n by n) matrix

Examples

1
2
A<-genQ(3)
round(crossprod(A),digits=10)

bootSVD documentation built on Feb. 2, 2021, 5:06 p.m.