harmonics: (Hyper)spherical harmonics

harmonicsR Documentation

(Hyper)spherical harmonics

Description

Computation of a certain explicit representation of (hyper)spherical harmonics on S^{p-1}:=\{{\bf x}\in R^p:||{\bf x}||=1\}, p\ge 2. Details are available in García-Portugués et al. (2021).

Usage

g_i_k(x, i = 1, k = 1, m = NULL, show_m = FALSE)

Arguments

x

locations in S^{p-1} to evaluate g_{i,k}. Either a matrix of size c(nx, p) or a vector of size p. Normalized internally if required (with a warning message).

i, k

alternative indexing to refer to the i-th (hyper)spherical harmonic of order k. i is a positive integer smaller than d_p_k and k is a non-negative integer.

m

(hyper)spherical harmonic index, as used in Proposition 2.1. The index is computed internally from i and k. Defaults to NULL.

show_m

flag to print m if computed internally when m = NULL.

Details

The implementation uses Proposition 2.1 in García-Portugués et al. (2021), which adapts Theorem 1.5.1 in Dai and Xu (2013) with the correction of typos in the normalizing constant h_\alpha and in the definition of the function g_\alpha of the latter theorem.

Value

A vector of size nrow(x).

References

Dai, F. and Xu, Y. (2013). Approximation Theory and Harmonic Analysis on Spheres and Balls. Springer, New York. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/978-1-4614-6660-4")}

García-Portugués, E., Paindaveine, D., and Verdebout, T. (2021). On the power of Sobolev tests for isotropy under local rotationally symmetric alternatives. arXiv:2108.09874. https://arxiv.org/abs/2108.09874

Examples

n <- 3e3
old_par <- par(mfrow = c(2, 3))
k <- 2
for (i in 1:d_p_k(p = 3, k = k)) {
  X <- r_unif_sph(n = n, p = 3, M = 1)[, , 1]
  col <- rainbow(n)[rank(g_i_k(x = X, k = k, i = i, show_m = TRUE))]
  scatterplot3d::scatterplot3d(X[, 1], X[, 2], X[, 3], color = col,
                               axis = FALSE, pch = 19)
}
for (k in 0:5) {
  X <- r_unif_sph(n = n, p = 3, M = 1)[, , 1]
  col <- rainbow(n)[rank(g_i_k(x = X, k = k, i = 1, show_m = TRUE))]
  scatterplot3d::scatterplot3d(X[, 1], X[, 2], X[, 3], color = col,
                               axis = FALSE, pch = 19)
}
par(old_par)

sphunif documentation built on Aug. 21, 2023, 9:11 a.m.