Learn R Programming

sphunif (version 1.4.3)

Uniformity Tests on the Circle, Sphere, and Hypersphere

Description

Implementation of uniformity tests on the circle and (hyper)sphere. The main function of the package is unif_test(), which conveniently collects more than 35 tests for assessing uniformity on S^{p-1} = {x in R^p : ||x|| = 1}, p >= 2. The test statistics are implemented in the unif_stat() function, which allows computing several statistics for different samples within a single call, thus facilitating Monte Carlo experiments. Furthermore, the unif_stat_MC() function allows parallelizing them in a simple way. The asymptotic null distributions of the statistics are available through the function unif_stat_distr(). The core of 'sphunif' is coded in C++ by relying on the 'Rcpp' package. The package also provides several novel datasets and gives the replicability for the data applications/simulations in García-Portugués et al. (2021) , García-Portugués et al. (2023) , Fernández-de-Marcos and García-Portugués (2024) , and García-Portugués et al. (2025) .

Copy Link

Version

Install

install.packages('sphunif')

Monthly Downloads

301

Version

1.4.3

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Eduardo Portugues

Last Published

November 9th, 2025

Functions in sphunif (1.4.3)

Sobolev

Asymptotic distributions of Sobolev statistics of spherical uniformity
avail_tests

Available circular and (hyper)spherical uniformity tests
Gegenbauer

Gegenbauer polynomials and coefficients
Gauss_Legen

Gauss--Legendre quadrature
Pn

Utilities for projected-ecdf statistics of spherical uniformity
A_theta_x

Surface area of the intersection of two hyperspherical caps
Sobolev_coefs

Transformation between different coefficients in Sobolev statistics
angles_to_sphere

Conversion between angular and Cartesian coordinates of the (hyper)sphere
Psi

Shortest angles matrix
F_from_f

Distribution and quantile functions from angular function
cir_gaps

Circular gaps
comets

Comet orbits
cir_coord_conv

Transforming between polar and Cartesian coordinates
harmonics

(Hyper)spherical harmonics
p_Kolmogorov

Asymptotic distributions for circular uniformity statistics
beta_inc

The incomplete beta function and its inverse
ecdf_bin

Efficient evaluation of the empirical cumulative distribution function
chisq

Density and distribution of a chi squared
craters

Craters named by the IAU
cir_stat_Kuiper

Statistics for testing circular uniformity
sort_each_col

Sort the columns of a matrix
int_sph_MC

Monte Carlo integration of functions on the (hyper)sphere
rot_ab

Rotate a sample of spherical data
r_unif

Sample uniformly distributed circular and spherical data
sph_stat_Rayleigh

Statistics for testing (hyper)spherical uniformity
proj_unif

Projection of the spherical uniform distribution
locdev

Local projected alternatives to uniformity
r_alt

Sample non-uniformly distributed spherical data
planets

Planet orbits
rhea

Rhea craters from Hirata (2016)
unif_stat

Circular and (hyper)spherical uniformity statistics
venus

Venus craters
unif_stat_distr

Null distributions for circular and (hyper)spherical uniformity statistics
unif_stat_MC

Monte Carlo simulation of circular and (hyper)spherical uniformity statistics
p_sph_stat_Bingham

Asymptotic distributions for spherical uniformity statistics
sphunif-package

sphunif: Uniformity Tests on the Circle, Sphere, and Hypersphere
unif_test

Circular and (hyper)spherical uniformity tests
sph_stat_Sobolev

Finite Sobolev statistics for testing (hyper)spherical uniformity
unif_cap

Uniform spherical cap distribution
utils

Low-level utilities for sphunif
wschisq_utils

Utilities for weighted sums of non-central chi squared random variables
wschisq

Weighted sums of non-central chi squared random variables