Skip to content

TST/ENH: support for formulas in zero inflated models #6803

Open

Description

@josef-pkt

question on mailing list

It looks like there are no unit tests and examples for from_formula for ZIP or ZINB.

Usage should be
ZeroInflatedPoisson.from_formula("count ~ bin + animal", my_dataframe)

with keyword options for
exog_infl=None, offset=None, inflation='logit', exposure=None

In my main notebook I used only numpy directly
https://gist.github.com/josef-pkt/c932904296270d75366a24ee92a4eb2f

ZeroInflated models are also not in formula.api

Activity

  1. josef-pkt commented on Jun 12, 2020

    @josef-pkt
    MemberAuthor

    I tried a simple example for ZIP from_formula and it works correctly.
    I had made a comment in the PR #3908 (comment)

    needs unit tests

    There is no formula support for exog_infl, see #3903

  2. josef-pkt commented on Aug 7, 2021

    @josef-pkt
    MemberAuthor

    related issue: if we have formula in creating the model, then we need also formula support for transform in predict and related methods like get_distribution.

  3. added this to the 0.16 milestone on Nov 27, 2024
  4. josef-pkt commented on Nov 27, 2024

    @josef-pkt
    MemberAuthor

    bump for 0.16

  5. josef-pkt commented on Nov 27, 2024

    @josef-pkt
    MemberAuthor

    results.predict could infer exog_infl from data frame, i.e. we only need one exog data frame given by user

    https://stats.stackexchange.com/questions/657805/error-in-fitting-zero-inflated-negative-binomial-in-python-using-cross-validatio

    best to wait until after formulaic has been integrated #9423

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions