formula for comparing histograms using the Chi-Squared method is incorrect (Patch #1263)
Description
One of the input histograms (say H1) should be denoted the histogram of expected values (henceforth, E), and the other (H2) should be denoted the histogram of observed values (henceforth, O). Then, the numerator of the summation terms becomes
(O(I) - E(I))^2
(numerically the same, but renamed variables), while the denominator SHOULD BE simply
E(I)
NOT
E(I) + O(I)
See, eg, http://en.wikipedia.org/wiki/Pearson%27s_chi-square_test#Calculating_the_test-statistic
Trivial patch included. Note: it may break unit tests if the tests used the wrong formula for the expected value.
Associated revisions
fixed chi-square test, ticket #1263
Merge pull request #1263 from abidrahmank:pyCLAHE_24
History
Updated by Kirill Kornyakov about 13 years ago
- Tracker changed from Bug to Patch
Updated by Alexander Shishkov almost 13 years ago
- Target version deleted ()
Updated by Alexander Shishkov almost 13 years ago
- Assignee deleted (
Vadim Pisarevsky)
Updated by Vadim Pisarevsky almost 13 years ago
thanks! updated the code, tests and docs (r7626)
- Status changed from Open to Done
- Assignee set to Vadim Pisarevsky
Updated by Alexander Shishkov almost 13 years ago
- Target version set to 2.4.0