-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
add mode to stats:poisson_conf_limits #4622
Conversation
Appveyor failed in Python 3.4 elif interval == 'kraft-burrows-nousek':
if conflevel is None:
raise ValueError('Set conflevel for method {0}. (sigma is ignored.)'.format(interval))
conflevel = np.asanyarray(conflevel)
if np.any(conflevel <=0) or np.any(conflevel >= 1):
raise ValueError('Conflevel must be a number between 0 and 1.')
> if background < 0:
E TypeError: unorderable types: list() < int()
astropy\stats\funcs.py:698: TypeError
= 1 failed, 7464 passed, 96 skipped, 69 xfailed, 3 xpassed i |
Formula used for confidence interval. See notes for details. | ||
Default is ``'root-n'``. | ||
sigma : float | ||
Number of sigma for confidence interval; only supported for | ||
the 'frequentist-confidence' mode. | ||
background : float | ||
Number of counts exspected from the background; only supported for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expected*
Now some Travis tests failed =================================== FAILURES ===================================
______________________ test_poisson_limit_nodependencies _______________________
@pytest.mark.skipif('HAS_SCIPY or HAS_MPMATH')
def test_poisson_limit_nodependencies():
with pytest.raises(ImportError) as e:
> a = funcs.poisson_conf_interval(20., 10., .95) |
Although this problem seems insensitive for the choice of a prior, I think it should be stated somewhere that the code uses a positively defined uniform prior. (The authors also use exponential and Lorentzian priors, for comparison). |
0c9cb5c
to
c94257d
Compare
I've added only a single line that's not covered by tests and that line is for compatibility with numpy 1.6 (where we don't run coveralls). |
It's an optional dependency for my new code. I need to add it to make sure new code is covered.
@astrofrog : Can you restart the Travis tests? Seems that continuum.io was down (or things happened in ci-helpers ...) |
See @cdeil's message on astropy-dev. I think this isn't fixed yet, but will try. |
I get the astropy-dev in "daily digest" so I did not see that yet.
Thanks! Will wait until continuum's servers are up again.
|
Any more comments anyone or can this be merged? |
@crawfordsm @astronomeralex - any comments on this (as astropy.stats maintainers), or can we merge it? |
Finally got a chance to give this a final-review. Thanks for the contribution @hamogu ! |
add mode to stats:poisson_conf_limits
'kraft-burrows-nousek'** This is a Bayesian appraoch which allows
for the presence of a known background :math:
B
in the source signal:math:
N
.http://adsabs.harvard.edu/abs/1991ApJ...374..344K