S2Fun.discrepancy edit page

kernel discrepancy between a discrete sample and a spherical density

Description

discrepancy measures how well a list of directions \(v_j\) with weights \(c_j\) represents the density function \(f\), by the squared distance

\[ J(v,c) = \| \mu - f \|_{\psi}^2 = \sum_{n=1}^N \frac{4\pi A_n}{2n+1} \sum_{k=-n}^{n} | \hat{\mu}_n^{k} - \hat{f}_n^{k} |^2, \qquad \mu = \lambda \, \sum_{j=1}^M c_j \, \delta_{v_j}, \quad \lambda = \int_{S^2} f(v) \,dv, \]

i.e. the functional optimalSample minimizes. Here \(A_n\) are the Legendre coefficients of the restricted distance kernel and \(N\) is the bandwidth - only the harmonic degrees up to \(N\) are compared, so state the one the sample is meant for.

Degree 0 is left out. The restricted distance kernel is only conditionally positive definite, its coefficient of degree 0 being negative, and the weights are normalized to sum up to 1, which makes that degree vanish anyway.

Scaling \(f\) multiplies the result by \(\lambda^2\), hence discrepancies are comparable only between samples of the same function.

Give the same bandwidth the sample was optimized for. Above it nothing was optimized, and since a sample gains its accuracy up to bandwidth partly at the expense of the higher degrees, scoring beyond it ranks two samples by the part neither of them minimized.

Syntax

res = discrepancy(sF,v)
res = discrepancy(sF,v,'weights',c)
res = discrepancy(sF,v,'bandwidth',64)

Input

sF S2Fun
v vector3d, the sampling points

Output

res double

Options

weights weights of the sampling points (default = ones(M,1)/M)
bandwidth harmonic degree to compare up to (default = the bandwidth of sF)

See also

S2Fun.optimalSample S2Fun.discreteSample S2RestrictedDistanceKernel

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/S2Fun.discrepancy.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.