Skip to content

ENH: zero-inflated poisson #1086

Closed
Closed

Description

@jseabold

Parking this here in case someone else gets an itch. I need the estimation only right now. Shouldn't be too much more work to add analytic derivatives, Vuong test, results class, summary etc.

https://gist.github.com/jseabold/6617976

Activity

  1. josef-pkt commented on Sep 19, 2013

    @josef-pkt
    Member
  2. jseabold commented on Sep 19, 2013

    @jseabold
    MemberAuthor

    Guess I should've grep'd first.

  3. josef-pkt commented on Sep 19, 2013

    @josef-pkt
    Member

    I just checked: IIRC, I had an example against R (package ?), but it didn't make it into the test suite.
    To check GenericLikelihoodModel I added tests against R for the TModel in my last round.

    pvalues in GenericLikelihoodModel are normal based
    needs check: the generic default df_model is set based on the number of parameters or number of exog
    (used only in summary and t_test, f_test which are not normal based). I don't know how it works in this case.

    If all goes well, then print res.summary() should work in your gist.

    I guess link should go into __init__ as in GLM.

  4. jseabold commented on Sep 19, 2013

    @jseabold
    MemberAuthor

    Nice. Summary does work. Could use a few tweaks on what's available, but that's neat. Need to figure out how best to hook in inflateX to the data handling, so we get the extra param names.

    Right now, extra data are not checked for being pandas objects, etc. Might need some kind of flag, or just handle it specifically in this model and not try to make the data handling stretch too much. I'm not sure yet how best to do it.

  5. josef-pkt commented on Sep 19, 2013

    @josef-pkt
    Member

    We get more of these kind of double exog. So we need to figure out a generic solution.

    I was reading up again on FGLS (HetGLS in the sandbox) with one regression for mean and one for variance, (and heteroscedasticity robust cov_params on top of it for the mean regression).

    The R package I looked at had two different summary, one for Poisson part and one for the Zero Inflation part.
    Depends also on whether the two models are estimated jointly (one large cov_params) or separately (2 cov_params or one block diagonal cov_params).
    Chad has something similar with 2 part iterative regression in one of his regime switching models.

  6. jseabold commented on Sep 19, 2013

    @jseabold
    MemberAuthor

    Will have to look at Chad's work. Hurdle model may be next on my agenda. but I'm not certain we'll actually need it for current project. One regime for zeros, one for non-zero process.

  7. josef-pkt commented on Sep 19, 2013

    @josef-pkt
    Member

    @vincentarelbundock yes I'm pretty sure I looked at ZIP in pscl. But that was a while ago and I thought Kleiber and Zeileis worked more recently on it.

  8. josef-pkt commented on Sep 19, 2013

    @josef-pkt
    Member

    @jseabold

    Need to figure out how best to hook in inflateX to the data handling, so we get the extra param names.

    you can try to add keyword extra_params_names=['par1', ... ]
    in the super call in __init__

    there is also a
    self._set_extra_params_names(extra_params_names)
    It fills up the list of names given what is not yet available (too short) in data.exog_names. IIRC

    But I doubt I tested all combinations for setting extra param names.

  9. josef-pkt commented on Sep 19, 2013

    @josef-pkt
    Member

    In TModel which was one of my main test cases for GenericLikelihoodModel, I used the initialize method to overwrite some of the defaults, with a line

    self._set_extra_params_names(extra_params_names)

  10. jseabold commented on Sep 19, 2013

    @jseabold
    MemberAuthor

    Added vuong_test for reference. Can be more general than a test for Poisson vs. Zero-Inflated, so maybe useful elsewhere.

  11. jbrockmendel commented on Sep 2, 2018

    @jbrockmendel
    Contributor

    @josef-pkt this has been implemented right? Closeable?

  12. jseabold commented on Mar 14, 2021

    @jseabold
    MemberAuthor

    Closed by #3908.

  13. added this to the 0.13 milestone on Sep 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions