sphere.runif: Generate Uniform Samples on Sphere

Description Usage Arguments Value References See Also Examples

View source: R/special_sphere.R

Description

It generates n random samples from \mathcal{S}^{p-1}. For convenient usage of users, we provide a number of options in terms of the return type.

Usage

1
sphere.runif(n, p, type = c("list", "matrix", "riemdata"))

Arguments

n

number of samples to be generated.

p

original dimension (of the ambient space).

type

return type;

"list"

a length-n list of length-p vectors.

"matrix"

a (n\times p) where rows are unit vectors.

"riemdata"

a S3 object. See wrap.sphere for more details (Default).

Value

an object from one of the above by type option.

References

\insertRef

chikuse_statistics_2003Riemann

See Also

wrap.sphere

Examples

1
2
3
4
5
6
7
8
#-------------------------------------------------------------------
#                       Draw Samples on Sphere
#
# Multiple return types on S^4 in R^5
#-------------------------------------------------------------------
dat.list = sphere.runif(n=10, p=5, type="list")
dat.matx = sphere.runif(n=10, p=5, type="matrix")
dat.riem = sphere.runif(n=10, p=5, type="riemdata")

Riemann documentation built on June 20, 2021, 5:07 p.m.