runif_cube {vdg} | R Documentation |
Sampling for hyperspheres/hypercubes
Description
Sample uniformly in or on a hyperspheres or hypercubes.
Usage
runif_cube(n, m = 2, max.dist = 1, at = FALSE, nr.dist = 21)
runif_sphere(n, m = 2, max.radius = sqrt(m), at = FALSE, nr.rad = 21)
Arguments
n |
number of points to sample |
m |
number of design factors |
max.dist |
maximum distance from origin (L-infinity norm/supremum distance) for the hypercuboidal design region (enveloping hypercube) |
at |
logical indicating whether to sample on concentric hyperspheres/hypercubes or not. With this
option |
nr.dist |
the number of concentric hypercubes to use in case at is |
max.radius |
maximum radius of the hyperspherical design region (enveloping hypersphere) |
nr.rad |
number of concentric hyperspheres to sample on in case of |
Author(s)
Pieter C. Schoonees
References
Pieter C. Schoonees, Niel J. le Roux, Roelof L.J. Coetzer (2016). Flexible Graphical Assessment of Experimental Designs in R: The vdg Package. Journal of Statistical Software, 74(3), 1-22. doi:10.18637/jss.v074.i03.
Examples
set.seed(1234)
runif_sphere(n = 10)
set.seed(1234)
samp <- runif_sphere(n = 500, at = TRUE)
plot(samp, asp = 1)