medpy.metric.histogram.relative_bin_deviation#

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

Calculate the bin-wise deviation between two histograms.

The relative bin deviation between two histograms \(H\) and \(H'\) of size \(m\) is defined as:

\[d_{rbd}(H, H') = \sum_{m=1}^M \frac{ \sqrt{(H_m - H'_m)^2} }{ \frac{1}{2} \left( \sqrt{H_m^2} + \sqrt{{H'}_m^2} \right) }\]

Attributes:

  • a real metric

Attributes for normalized histograms:

  • \(d(H, H')\in[0, \infty)\)

  • \(d(H, H) = 0\)

  • \(d(H, H') = d(H', H)\)

Attributes for not-normalized histograms:

  • \(d(H, H')\in[0, \infty)\)

  • \(d(H, H) = 0\)

  • \(d(H, H') = d(H', H)\)

Attributes for not-equal histograms:

  • not applicable

Parameters:
h1sequence

The first histogram.

h2sequence

The second histogram, same bins as h1.

Returns:
relative_bin_deviationfloat

Relative bin deviation between the two histograms.