runif_in_pball: Uniform sampling in a p-ball

View source: R/pball.R

runif_in_pballR 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)

uniformly documentation built on March 18, 2022, 6:44 p.m.