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

add mode to stats:poisson_conf_limits #4622

Merged
merged 12 commits into from
Mar 12, 2016

Conversation

hamogu
Copy link
Member

@hamogu hamogu commented Feb 22, 2016

'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

@pllim
Copy link
Member

pllim commented Feb 22, 2016

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
Copy link
Member

Choose a reason for hiding this comment

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

expected*

@pllim
Copy link
Member

pllim commented Feb 22, 2016

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)

@mirca
Copy link
Member

mirca commented Feb 22, 2016

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).

@hamogu
Copy link
Member Author

hamogu commented Feb 24, 2016

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).
So, I request to ignore the coveralls failure here.

@crawfordsm crawfordsm added this to the v1.2.0 milestone Feb 24, 2016
It's an optional dependency for my new code. I need to add it to make sure new code is covered.
@hamogu
Copy link
Member Author

hamogu commented Feb 25, 2016

@astrofrog : Can you restart the Travis tests? Seems that continuum.io was down (or things happened in ci-helpers ...)

@astrofrog
Copy link
Member

See @cdeil's message on astropy-dev. I think this isn't fixed yet, but will try.

@hamogu
Copy link
Member Author

hamogu commented Feb 25, 2016 via email

@hamogu
Copy link
Member Author

hamogu commented Mar 9, 2016

Any more comments anyone or can this be merged?

@astrofrog
Copy link
Member

@crawfordsm @astronomeralex - any comments on this (as astropy.stats maintainers), or can we merge it?

@crawfordsm
Copy link
Member

Finally got a chance to give this a final-review. Thanks for the contribution @hamogu !

crawfordsm added a commit that referenced this pull request Mar 12, 2016
add mode to stats:poisson_conf_limits
@crawfordsm crawfordsm merged commit 9fa6337 into astropy:master Mar 12, 2016
@hamogu hamogu deleted the bayes_upper_limit branch January 4, 2022 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants