analyst-ui
analyst-ui copied to clipboard
relative change formula seems wrong
While testing the application I noticed that lower average speeds have higher percentage changes when compared against the reference speeds. This is counter intuitive: a lower average speed should have a lower percentage change.
I checked the code and noticed that the formula to calculate the percentage change seems weird:
https://github.com/opentraffic/analyst-ui/blob/0a9861d40600a2d15656bbb424a54091050ecb1c/src/app/processing.js#L33
The way I would assume would be (average-reference)/reference *100
as per https://en.wikipedia.org/wiki/Relative_change_and_difference
Any particular reason we are not using the simple formula?