r_unif {sphunif} | R Documentation |
Sample uniformly distributed circular and spherical data
Description
Simulation of the uniform distribution on and
,
.
Usage
r_unif_cir(n, M = 1L, sorted = FALSE)
r_unif_sph(n, p, M = 1L)
Arguments
n |
sample size. |
M |
number of samples of size |
sorted |
return each circular sample sorted? Defaults to |
p |
integer giving the dimension of the ambient space |
Value
-
r_unif_cir
: a matrix of sizec(n, M)
withM
random samples of sizen
of uniformly-generated circular data on.
-
r_unif_sph
: an array of sizec(n, p, M)
withM
random samples of sizen
of uniformly-generated directions on.
Examples
# A sample on [0, 2*pi)
n <- 5
r_unif_cir(n = n)
# A sample on S^1
p <- 2
samp <- r_unif_sph(n = n, p = p)
samp
rowSums(samp^2)
# A sample on S^2
p <- 3
samp <- r_unif_sph(n = n, p = p)
samp
rowSums(samp^2)
[Package sphunif version 1.4.0 Index]