Skip to content

Add Poisson likelihood fitter #1056

Closed
Closed

Description

@cdeil

I would like to add a PoissonLikelihoodFitter as available e.g. in Sherpa (described here) to be able to fit Poisson count data.

A preliminary version can be found here: class, example.

TODO:

  • Make it work with n-dimensional models and data (currently only supports 1-dimensional)
  • Pass extra arguments along to scipy.optimize.minimize.
  • Is this the right way to handle integral models?

cc @nden, @embray Should I try to implement this now and get it into astropy or should I wait for your modeling APE and further structural changes in astropy.modeling?

EDIT: the issue description was updated, so some comments below are outdated / irrelevant now.

Activity

  1. eteq commented on May 6, 2013

    @eteq
    Member

    I don't know if we ever fully specified a version. It's already an "optional" dependency, so using whatever version makes sense is fine.

    Probably the best thing to do is a try/except inside the function that explicitly states something like "Scipy 0.11 is needed for custom fit functions"

  2. cdeil commented on Oct 19, 2013

    @cdeil
    MemberAuthor

    Here's a first prototype version: http://nbviewer.ipython.org/7062154
    that I managed to write thanks to @nden's example here: https://gist.github.com/nden/5466946

    @nden At the moment to create a user-defined fitter one has to add to the constraintsdef dict (or the Fitter initialisation will fail in the _constraintscheck):

    from astropy.modeling.fitting import constraintsdef
    constraintsdef['CashFitter'] = ['fixed']
    

    I guess this shouldn't be needed?
    If it is, it should be described here.

  3. embray commented on Oct 23, 2013

    @embray
    Member

    Nice. I do think there are some areas where defining a new fitter could be easier. I have a note somewhere, for example, that the constraintsdef dict shouldn't be used explicitly anywhere, and that the purpose it serves could be handled automatically by a Fitter metaclass and a couple class attributes. We'll see if I get to that. Defining the errorfunc could be a bit easier too. But overall it looks like that was pretty easy.

  4. cdeil commented on Oct 24, 2013

    @cdeil
    MemberAuthor

    +1 to removing the global constraintsdef dict and storing this info in classes.

  5. embray commented on Oct 24, 2013

    @embray
    Member

    Done in 3552d36

  6. modified the milestones: v1.0.0, v0.4.0 on May 3, 2014
  7. astrofrog commented on Jan 14, 2015

    @astrofrog
    Member

    +1 to the idea, but removing 1.0 milestone

  8. removed this from the v1.0.0 milestone on Jan 14, 2015
  9. cdeil commented on Mar 2, 2016

    @cdeil
    MemberAuthor

    We're using Sherpa now, so we don't need this in Astropy any more and I don't plan to work on it there.
    Closing this old issue.

  10. embray commented on Mar 2, 2016

    @embray
    Member

    Would rather leave issues like this open--just because you don't need it or plan on working on it for Astropy doesn't mean it's not a good issue to keep open.

  11. reopened this on Mar 2, 2016
  12. changed the title [-]WIP: Add Poisson likelihood fitter[/-] [+]Add Poisson likelihood fitter[/+] on Mar 2, 2016
  13. cdeil commented on Mar 2, 2016

    @cdeil
    MemberAuthor

    An issue is mainly useful if there's a chance that it leads to improvements, right?

    If it's just a bunch of year-old and outdated discussion keeping it open and making people re-read through it is just annoying.

    In this case if someone is interested to implement this in astropy.modeling, they should ignore the discussion here and continue with #3786 .

  14. added
    Close?Tell stale bot that this issue/PR is stale
    on Mar 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Close?Tell stale bot that this issue/PR is stalemodeling

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions