Learn R Programming

HI (version 0.5)

rballunif: Function to generate a random vector uniformly distributed in a sphere

Description

Generates a random vector from a uniform distribution in a sphere centered at the origin

Usage

rballunif(n,d)

Arguments

n

Dimension of the random vector to be generated

d

Radius of the sphere

Value

An pseudo-random vector from a uniform distribution in the n-dimensional sphere centered at the origin and having radius d

Details

The function is not vectorized: it is intended to generate one random vector at a time.