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

Best likelihood increasing (positive value) instead of decreasing #200

Merged
merged 6 commits into from
Jan 28, 2019

Conversation

KittelC
Copy link
Contributor

@KittelC KittelC commented Jan 25, 2019

Moved statement checking whether likelihood should be false to be taken into account in likelihood calculation.

I am using SCEUA to calibrate hydrological models and I realised when updating my Spotpy module to 1.14 from 1.13.10 that the objective function was positive and therefore increasing rather than decreasing. I propose to move the "negativelike" statement up in the postprocessing function in _algorithm.py - I am not familiar enough with the code to be sure that this has no other effects, but it would seem logical to not only save the likelihood as a negative value is negativelike is True (which appears to be hardcoded in the sceua algorithm), but also to return it from the function as negative (as far as I can see that is the main change).

Moved statement checking whether likelihood should be false to likelihood calculation.
@coveralls
Copy link

coveralls commented Jan 28, 2019

Pull Request Test Coverage Report for Build 649

  • 18 of 19 (94.74%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 88.733%

Changes Missing Coverage Covered Lines Changed/Added Lines %
spotpy/algorithms/abc.py 1 2 50.0%
Totals Coverage Status
Change from base Build 642: 0.03%
Covered Lines: 4875
Relevant Lines: 5494

💛 - Coveralls

@thouska
Copy link
Owner

thouska commented Jan 28, 2019

Hi @KittelC,
thank you very much for your proposed change and for reporting this major bug! I highly appreciate your work!
I included your proposed change, added a view other lines because of some minor subsequent errors and will upload a new spotpy version on pypi (1.4.1) today.
I included also a short tutorial for the use of sceua as the use of the negativelike statement is unfortunately very confusing and changed a couple of times during the development of spotpy.

@thouska thouska merged commit 436b6fe into thouska:master Jan 28, 2019
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.

3 participants