Learn R Programming

evolvability (version 2.0.0)

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.

Examples

Run this code
# NOT RUN {
# Two vectors of dimension 3:
randomBeta(n = 2, k = 3)
# }

Run the code above in your browser using DataLab