Skip to content

ENH/Design: GLM - add endog type (discrete, continuous, family) specific results statistics #7687

Open

Description

@josef-pkt

Some results statistics in GLM are only available for some types of endog or some families.
We should find a way to add them to the results class as family dependent results.

examples

for simple cases like adding McFadden pseudo R2, we need a flag for discrete distributions.
In many cases we fix scale=1 for the same list of cases.

Tweedie is for mixed type, continuous with a mass point. For McFadden pR2 this means it is not discrete.

We can have a consistent interface if we add generic methods names like get_diagnostic and we return an instance of family/type specific classes.

This avoids special case methods like pred_table, that apply only in some cases, and would be noise in others. We avoid instance methods as much as possible to avoid pickling problems.

Activity

  1. josef-pkt commented on Sep 4, 2021

    @josef-pkt
    MemberAuthor

    I'm not planning to black out (set to nan or raise) Likelihood statistics for QMLE cases, e.g. when using Poisson for continuous endog.

    In the current setting, there is no clear indication that users want QMLE, except for adjusting wald_test with robust cov_type.
    I don't think it's good to broaden cov_type to the interpretation to general is_misspedified = True.
    (e.g. HC, overdispersion, heteroscedasticity could mean something like negbin instead of poisson and not continuous distribution on R+ instead of discrete.)
    R has explicit quasi-poisson family for over- or excess dispersion, and, AFAIR, Stata has now QMLE for continuous variables based on Binomial/Binary and Poisson, e.g. for continuous fractions.

  2. josef-pkt commented on Sep 8, 2021

    @josef-pkt
    MemberAuthor

    example plots
    #7687 for binary

    i.e in GLM plots we need to distinguish by type of endog, binary, count, continuous, mixed/tweedie

  3. josef-pkt commented on Oct 12, 2021

    @josef-pkt
    MemberAuthor

    I'm starting with dfamilies for #7778

    codes/names by domain of endog

    I started dfamilies for most of the following

    • "real" e.g. Gaussian, T, Logistic, ....
    • "realp", "realpp" continuous on R+or R++, e.g. Gamma, Weibull
    • "ui" unit interval (maybe a longer name ?) ("int" abbreviate integers, and not interval), e.g. Beta
    • "int" integers including negative, None yet, maybe discretized count, scipy has one or more
    • "intp" non-negative integers, mainly countdata models
    • "intpf" non-negative integers with finite domain, e.g. Binomial, Beta-Binomial

    **not clear: **

    These are basically multinomial, structure comes from model parameterization, can be multivariate.
    But we are starting to have some diagnostics specific to those.

    • categorical
    • ordinal

    do we need a specific distribution for binary?

    • Bernoulli

    Ordinal and Bernoulli are essentially implemented as interval censored rv. That's a modifier, and not a basic distribution.
    Similarly, DiscretizedCount.

    need also, (not sure what generic support we get for those)

    • mixed discrete-continuous: Tweedie. Zero-Inflated Beta, left or right censored
      • but inflation and censoring is a modifier, not a basic distribution

    For modifiers, we have the choice between adding those to dfamilies or to the model.
    e.g. is censoring handled in the model.loglike or in the dfamily.loglike.

    aside: if we need derivatives for cdf (for censoring), then, I guess, they should go into the dfamily.
    AFAIR, currently binomial/ordinal censoring uses fixed scale.
    model candidate to check: ordinal with heteroscedasticity.
    What derivatives do we need for censored weibull and gaussian/Tobit?

  4. added this to the 0.15 milestone on Apr 14, 2023
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