randomBeta: Generating selection gradients/vectors in random directions.
Description
randomBeta generates unit length vectors (selection gradients)
uniformly distributed in a k-dimensional hypersphere.
Usage
randomBeta(n = 1, k = 2)
Arguments
n
Number of selection gradients/vectors.
k
Number of dimensions.
Value
randomBeta returns a matrix where the vectors are stacked column
wise.
Details
randomBeta exploits the spherical symmetry of a multidimensional
Gaussian density function. Each element of each vector is randomly sampled
from a univariate Gaussian distribution with zero mean and unit variance. The
vector is then divided by its norm to standardize it to unit length.