runiform_ball: Multivariate Uniform Distribution on a ball

Description Usage Arguments Details Value Examples

Description

This function generates random samples from multivariate uniform distribution on a ball in R^d, equipped with L^{2} norm (i.e., Euclidean distance), centered in 0, with radius R.

Usage

1
runiform_ball(n, d, R)

Arguments

n

number of desired samples.

d

positive integer, representing the dimension of the observations.

R

positive real value, the radius of the ball in R^d.

Details

This function generates samples from the multivariate uniform distribution whose density is

π(c, R) = Γ(d/2 + 1)/ π^{d/2} * 1/(R)^{d} 1_{B_{d}(R)}(c),

where 1_{B_{d}(R)} is a centered L^{2} ball with radius R.

Value

a matrix of n samples of length d.

Examples

1
2
3
##generating 10000 samples from uniform distribution on a unit ball in \strong{R}^{2}
result <- runiform_ball(10000, 2, 1)
plot(result)

Example output

Loading required package: mnormt

PACBO documentation built on May 2, 2019, 2:05 a.m.

Related to runiform_ball in PACBO...