the discrepancy between two measures on the sphere, densities or weighted point sets in any pairing: D_2, D_cap or a bandlimited L2 norm; MATLAB’s S2Fun/discrepancy and vector3d/discrepancy

Syntax

d = sphericalDiscrepancy(v, w)

D_2 of two point sets.

d = sphericalDiscrepancy(v, w, weights=c, weights2=e)

Of two weighted point sets.

d = sphericalDiscrepancy(f, v)

Of a density and a sample.

d = sphericalDiscrepancy(v, w, 'L2', bandwidth=32, degreeWeights=lambda l: np.exp(-0.1 * l * (l + 1)))

A weighted harmonic norm.

d, info = sphericalDiscrepancy(v, w, 'D_cap', numCenters=4097, info=True)

The largest cap difference and its cap.

Description

With C(m, t) = {x : m.x >= t} the spherical caps and nu = mu - eta the difference of the two measures, the metric is one of:

  • ‘D_2’, the default: the root of the mean of |nu(C(m, t))|^2 over all caps, by Stolarsky’s identity nu(S2)^2 - 1/4 int int |x - y| dnu dnu. Point sets are taken exactly, at a cost quadratic in the number of points; functions through their harmonic expansion.
  • ‘D_cap’: the largest |nu(C(m, t))|, found by a finite search over centres and heights. It is a lower bound; raise numCenters and numHeights until it settles.
  • ‘L2’, also ‘E_L’: the root of the weighted sum of the squared harmonic coefficients of nu up to the bandwidth.

All three count a difference in total mass: two densities differing only in their integral have a positive discrepancy. Point weights are normalised to sum one, and a point set compared with a function takes the function’s integral (one if that vanishes). An antipodal point set puts half its mass at +x and half at -x.

MATLAB’s metric ‘kernel’, the objective of optimalSample, is taken by discrepancy, not here.

Input

a, b S2Fun, a real scalar density, or vector3d, a point set
metric ‘D_2’, ‘D_cap’ or ‘L2’ (also ‘E_L’)

Keywords

keyword default description
weights None the non negative weights of the points of a
weights2 None the weights of the points of b
bandwidth None the harmonic degree of the projection of the functions and of the L2 moments; by default the largest bandwidth of the functions, 128 for two point sets
degreeWeights None the L2 weights of the degrees 0..L, an array or a function of the degree; ones by default, degree zero weighting the difference in total mass
numCenters 2049 the number of cap centres D_cap searches, besides the coordinate axes and the points
numHeights 257 the number of heights D_cap searches, besides the jumps at the points
centers None vector3d, the cap centres D_cap searches instead
squared False return the square of D_2 and L2
info False return the details too, as a second output

Output

d the discrepancy, its square with squared=True
info with info=True: method, isExact, bandwidth, and for D_cap the cap found, center, height, closed (False for the limit of open caps), signedDifference

See also

discrepancy, rotationalDiscrepancy, optimalSample

MATLAB’s sphericalDiscrepancy

source

Citing this page. This page is part of the documentation of MTEX, a free and open source MATLAB toolbox for analyzing and modeling crystallographic textures. It was written by The MTEX Developers and is published at https://mtex-toolbox.github.io/sphericalDiscrepancy_py.html. If you use MTEX, or reuse text or figures from this page, in your research, please cite

F. Bachmann, R. Hielscher, H. Schaeben: Texture Analysis with MTEX - Free and Open Source Software Toolbox, Solid State Phenomena 160 (2010), 63-68. 10.4028/www.scientific.net/SSP.160.63

BibTeX
@article{bachmann2010mtex,
  author  = {F. Bachmann and R. Hielscher and H. Schaeben},
  title   = {Texture Analysis with MTEX - Free and Open Source Software Toolbox},
  journal = {Solid State Phenomena},
  volume  = {160},
  pages   = {63-68},
  year    = {2010},
  doi     = {10.4028/www.scientific.net/SSP.160.63},
  url     = {https://doi.org/10.4028/www.scientific.net/SSP.160.63}
}

Other papers describing specific MTEX methods are listed under Publications — please cite the one that best fits your application. The MTEX source code is licensed under the GNU General Public License v2.0; the text and figures of this documentation are licensed under CC BY 4.0, which permits reuse — including by automated systems — provided The MTEX Developers and this page are credited.