Skip to content
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

Alternative implementation of the scatter index #142

Merged
merged 4 commits into from
Oct 12, 2022

Conversation

jsmariegaard
Copy link
Member

Closes #137

@jsmariegaard
Copy link
Member Author

@daniel-caichac-DHI could you help to test by comparing it to your internal implementation of SI?

@daniel-caichac-DHI
Copy link
Collaborator

daniel-caichac-DHI commented Oct 11, 2022

I compared the results and I get the same, so at least the math is ok.
It is failing the tests for some reason though (?)
I assume that the SI tests will not assert now, since it will give a different result (hence the tests should be updated?)

\\sqrt {\frac{1}{n} \\sum_{i=1}^n \\left( (model_i - \\overline {model}) - (obs_i - \\overline {obs}) \\right)^2
{\frac{1}{n} \\sum_{i=1}^n obs_i^2}}

Range: [0, 100]; Best: 0
Copy link
Member

@ecomodeller ecomodeller Oct 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the range and the best value is correct🤔

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that the value is between 0 and 1, but the best value should be 0 (if BIAS=0 and model=measurement, which would a Perfect Model , then the Numerator is 0)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that the best value is 0, but the range is $(-\infty, \infty)$.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, the denominator should be the mean of the abs (x) and then the range could not be negative.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better now?

image

Copy link
Collaborator

@daniel-caichac-DHI daniel-caichac-DHI Oct 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alright done, I checked against the other implementation and it gives the same result.
I updated the test as well ( I had no idea tests could fail on the docstring as well! )
In this branch the new SI implementation becomes the default, overriding the old one

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alright done, I checked against the other implementation and it gives the same result. I updated the test as well ( I had no idea tests could fail on the docstring as well! ) In this branch the new SI implementation becomes the default, overriding the old one

Take a look at Doctest 🤯

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now a question to both of you, this branch was uploaded by Jesper as a "draft", should we keep it like that? or should we merge to main? if so, what happens with the old SI implementation? select section + delete ? or we leave it as it is now (renamed as scatter_index2) and erase it in the future?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@daniel-caichac-DHI I think you are the only using this metric. (it doesn't make sense to anyone else😉)

📢 If anyone else is using this metric and wants to keep the other formulation, now is the time to speak up, otherwise it will be gone!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

everyone I know is using this metric!
I will remove the draft then and move it into the soon to be merged pipeline

@daniel-caichac-DHI daniel-caichac-DHI marked this pull request as ready for review October 12, 2022 13:47
@daniel-caichac-DHI daniel-caichac-DHI merged commit 3c0bae7 into main Oct 12, 2022
@jsmariegaard jsmariegaard deleted the scatter-index-alternative-implementation branch November 20, 2023 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SI calculation error
3 participants