Skip to content

SUMM REF make discrete more like GLM, added properties #2107

Open

Description

@josef-pkt

GLM has now a lot of nice generic features that makes it easy to write new semi generic functions on top of it.

discrete is still lacking support for several extensions, there are several issues open to refactor and enhance the discrete models, or MLE models in general (incoming BetaRegression will follow or already follows a similar pattern)

Latest example #2018 to support generic residual plots and added variable plots.

refactorings (still need to collect numbers for specific issues)

  • resid and fitted_values
  • attach link used in mean function (single index model for mean E(y|x)
    BetaRegression has two link functions
  • missing offset
  • exposure is stored in log form
  • score_factor, hessian_factor or similar to allow for score_tests
  • ...

more general:

  • better support for recreating models and fit, using the same options but different endog or exog
    this was mostly added for fit_constrained

Activity

  1. josef-pkt commented on May 24, 2018

    @josef-pkt
    MemberAuthor

    Bump for 0.10
    At least offset and score_factor should be high priority
    Andresid_pearson

    Two-part models will need extra work,e.g. two offset, two score factors

    And rename to loglike_obs

  2. added this to the 0.10 milestone on May 24, 2018
  3. modified the milestones: 0.10, 0.13 on Dec 15, 2020
  4. josef-pkt commented on Dec 15, 2020

    @josef-pkt
    MemberAuthor

    bump again

    #7166 (comment)

    We already have poisson family, I'm adding also family to Logit
    BUT I need just the link for models not covered by GLM

    -> add link property or cached property also to GLM and use it as consistent interface, e.g. in get_prediction

  5. modified the milestones: 0.13, 0.14 on Sep 29, 2021
  6. josef-pkt commented on Sep 29, 2021

    @josef-pkt
    MemberAuthor

    to be continued in 0.14

    we need more consistent structure for, e.g., get_distribution, get_influence in discrete models.

    (the same applies to OLS and regression, but I will open separate issue)

  7. josef-pkt commented on Nov 22, 2021

    @josef-pkt
    MemberAuthor

    GLM families have two disadvantages

    • one parameter families (auxiliary parameters are not part of params)
    • link instead of mean function (inverted)

    I'm expanding the use of families and links in discrete and othermod, but I don't really want to commit to it, and have them as part of the public API subject backwards compatibility restrictions.
    However, if I want to share code between GLM, and discrete/othermod, then I have to follow the same pattern and cannot privatize the name like Poisson._family instead of Poisson.family.

    Similarly, I added a link attribute in some cases in discrete models. BetaModel has link attributes but no family.
    For multilink, Het models, I started with dfamilies and it is still undecided whether link will be dfamily attributes or model attributes.

    Essentially, the api for families and links in discrete and othermod is still open and will take some time and many cases to settle down.

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