mgc.sims.2ball: Sample from Unit 2-Ball

Description Usage Arguments Value Author(s) Examples

View source: R/simulations.R

Description

Sample from the 2-ball in d-dimensions.

Usage

1
mgc.sims.2ball(n, d, r = 1, cov.scale = 0)

Arguments

n

the number of samples.

d

the number of dimensions.

r

the radius of the 2-ball. Defaults to 1.

cov.scale

if desired, sample from 2-ball with error sigma. Defaults to NaN, which has no noise.

Value

the points sampled from the ball, as a [n, d] array.

Author(s)

Eric Bridgeford

Examples

1
2
3
library(mgc)
# sample 100 points from 3-d 2-ball with radius 2
X <- mgc.sims.2ball(100, 3, 2)

neurodata/r-mgc documentation built on March 12, 2021, 9:45 a.m.