medpy.metric.histogram.quadratic_forms#

medpy.metric.histogram.quadratic_forms(h1, h2)[source]#

Quadrativ forms metric.

Notes

UNDER DEVELOPMENT

This distance measure shows very strange behaviour. The expression transpose(h1-h2) * A * (h1-h2) yields egative values that can not be processed by the square root. Some examples:

h1        h2                                          transpose(h1-h2) * A * (h1-h2)
[1, 0] to [0.0, 1.0] :                                -2.0
[1, 0] to [0.5, 0.5] :                                 0.0
[1, 0] to [0.6666666666666667, 0.3333333333333333] :   0.111111111111
[1, 0] to [0.75, 0.25] :                               0.0833333333333
[1, 0] to [0.8, 0.2] :                                 0.06
[1, 0] to [0.8333333333333334, 0.16666666666666666] :  0.0444444444444
[1, 0] to [0.8571428571428572, 0.14285714285714285] :  0.0340136054422
[1, 0] to [0.875, 0.125] :                             0.0267857142857
[1, 0] to [0.8888888888888888, 0.1111111111111111] :   0.0216049382716
[1, 0] to [0.9, 0.1] :                                 0.0177777777778
[1, 0] to [1, 0]:                                      0.0

It is clearly undesireable to recieve negative values and even worse to get a value of zero for other cases than the same histograms.