Following Hallin et al. (2021) and the OT2.R reference code, builds a
grid of n points on the unit ball \(S^d\) used as the target of
the center-outward transform (center_outward_transform).
The grid consists of:
n0copies of the origin;nRradial levels \(r_k = k/(n_R+1)\), \(k = 1, \ldots, n_R\), each carrying the samenSangular directions;
so that n0 + nR * nS = n. The nS directions are
quasi-uniform unit vectors on \(S^{d-1}\) (equally spaced angles for
d = 2, normalized Gaussian draws for d > 2, as in OT2.R).
Arguments
- n
Integer: total number of grid points.
- d
Integer: dimension of the ball.
- nR
Integer: number of radial levels.
- nS
Integer: number of angular directions per radial level.
- n0
Integer: number of copies of the origin, so that
n0 + nR * nS = n.- seed
Integer random seed for the quasi-uniform directions when
d > 2(unused ford <= 2, which are deterministic). The grid is reproducible for a given(nS, seed), sincenSis folded into the seed actually used. Defaults to42.
Examples
# n = n0 + nR * nS = 2 + 3 * 4
grid <- build_ball_grid(n = 14, d = 2, nR = 3, nS = 4, n0 = 2)
dim(grid)
#> [1] 14 2
