-
-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
r.kappa: Add MCC #2680
r.kappa: Add MCC #2680
Conversation
Although original code lacks any explanation why NA should not be printed for the first raster category, I do suspect it stems from idea that the first cat is 0 and before proper NULL support 0 was "no data" value.
Ping @wenzeslaus @nilason |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Neumaier's Kahan-Babuska algorithm fits with the version in Wikipedia. I did not check MCC itself.
Given that Kahan-Babuska is applied to existing code too, this may change some results, no? I see it does not change any of the tested code. I think it is the right thing to do and that we can do that between minor versions, but we may need to emphasize that in the release notes (as a separate item in "changed" besides addition to the MCC item).
I'm asking for some code tweaks in the comments.
In most of cases results shouldn't change. NKB will give different outcome only in rare corner cases or when n is large. |
While in math it is common to have the terms explicit, the current programming practices usually aim primarily at documenting intention given that people spend most of the time by reading code (theirs or someone else's), so a += b comes out better because it clearly says add b to a. In the following code:
did I really mean to do When using
Clearly I meant to add to the existing value. If I would really mean
|
This is a good reason. Thank you for pointing out to this aspect of coding style. |
You are welcome. I'm sorry I was not more clear before. |
* Report Matthews (Mattheus) Correlation Coefficient as one of measures * Use the Neumaier's Kahan-Babuska algorithm to minimize errors during summation
* Report Matthews (Mattheus) Correlation Coefficient as one of measures * Use the Neumaier's Kahan-Babuska algorithm to minimize errors during summation
This PR adds Matthews (Mattheus) Correlation Coefficient as one of indices provided by r.kappa.
Should be applied on the top of PR #2666