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

Improve Feldman Cousins code #813

Merged
merged 5 commits into from Dec 12, 2016

Conversation

Projects
None yet
2 participants
@dlennarz
Contributor

dlennarz commented Dec 8, 2016

In the calculation of average upper limit, the code now skip bins with low probability. This makes this code more robust and the user does not have to find a good range of x-values. The value for low probability is a new optional option of the fc_find_average_upper_limit. Add "try and except" for calculation of average upper limit and give user useful instructions on how to fix the problem.

Fixed an error in the documentation and removed the now unnecessary selection of x-bins.

dlennarz added some commits Dec 8, 2016

In calculation of average upper limit, skip bins with low probability…
… (the value for low probability is a new option of the fc_find_average_upper_limit). Add try and except for calculation of average upper limit and give user useful instructions on how to fix the problem.

@dlennarz dlennarz changed the title from Fc change to Improvments to Feldman Cousins code Dec 8, 2016

@cdeil cdeil self-assigned this Dec 9, 2016

@cdeil cdeil added cleanup docs labels Dec 9, 2016

@cdeil cdeil added this to the 0.6 milestone Dec 9, 2016

@cdeil

Thanks!

I've left two minor inline comments.

Otherwise, this is ready to go.
(I can't comment on the method / stats aspect, there I just trust it makes sense, and I'm OK to put it in without adding an extra test for this.)

Show outdated Hide outdated gammapy/stats/feldman_cousins.py Outdated
Show outdated Hide outdated gammapy/stats/feldman_cousins.py Outdated
@dlennarz

This comment has been minimized.

Show comment
Hide comment
@dlennarz

dlennarz Dec 10, 2016

Contributor

All requested changed implemented. Should be ready to merge.

Contributor

dlennarz commented Dec 10, 2016

All requested changed implemented. Should be ready to merge.

@cdeil

This comment has been minimized.

Show comment
Hide comment
@cdeil

cdeil Dec 12, 2016

Member

@dlennarz - Thank you!

Member

cdeil commented Dec 12, 2016

@dlennarz - Thank you!

@cdeil cdeil merged commit ac2d0c9 into gammapy:master Dec 12, 2016

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@cdeil cdeil changed the title from Improvments to Feldman Cousins code to Improve Feldman Cousins code Dec 12, 2016

@cdeil

This comment has been minimized.

Show comment
Hide comment
@cdeil

cdeil Dec 12, 2016

Member

There were some more parameters declared as double instead of float in Gammapy.
:-)
Fixed in 9a8c953

Member

cdeil commented Dec 12, 2016

There were some more parameters declared as double instead of float in Gammapy.
:-)
Fixed in 9a8c953

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment