Closed ar-siddiqui closed 2 years ago
Good catch, the formula should be 100 * (B - A)/ A which is the change from A to B:
The results using your numbers would then be: [[-20%, 100%]], a decrease to 20% for the first element, and a increase of 100% for the second.
Oops, [[-80%, 100%]]. math is hard.
Since, our Results Group name is A vs B
I think what we have might already be correct.
A is 80% greater than B, A is 100% smaller than B.
vs
If we change the formula it will be B is 80% less than A and B is 100% more than A
What do you think will be better considering our group name A vs B
? I think it is just a way of interpretation but thinking about it more I like the first one.
Sure, A vs B is ok, but then the equation becomes 100 * (A - B)/B. That way, if there if A DECREASED, the percentage is negative; if A increased, the percentage is positive.
I would like to stick with that usage: negative means a decrease, that is what we've trained users to expect. Think of it as the change from some original state to a new state. The percent change would be: 100 * (New - Original) / Original, and our naming convention would be New vs Original.
In the current code, I just think the denominator is wrong; it should be B.
Ok 100 * (A - B)/B
makes much more sense. Glad we caught this. Is this the same what OpenNSPECT had or is it different?
It should be the same.
Latest QNSPECT version
Similar issues do not exist
What is the bug or the crash?
Lets say we have raster A = [[5,1]] and B = [[1,2]]
When we calculate percent difference here expression="100 * ((A - B) / A)"
Our result will be [[80%, -100%]]. How do we interpret this ?
How to interpret results?
Steps to reproduce the issue
N/A
Screenshots and Attachements
No response
Versions
3.22.4
Additional context
No response