runif_in_pball {uniformly} | R Documentation |
Uniform sampling in a p-ball
Description
Uniform sampling in a p-ball (arbitrary dimension).
Usage
runif_in_pball(n, d, p, r = 1)
Arguments
n |
number of simulations |
d |
dimension |
p |
exponent in the p-norm, a positive number |
r |
positive number, the radius |
Value
The simulations in a n
times d
matrix.
Examples
sims <- runif_in_pball(500, d = 2, p = 1)
plot(sims, xlim = c(-1, 1), ylim = c(-1, 1), asp = 1)
[Package uniformly version 0.5.0 Index]