Skip to content

Inconsistency in get_robustcov usage #4025

Open

Description

@jbrockmendel

Some models call some variant of get_robustcov_results at the end of fit (e.g. GenericZeroInflated, GeneralizedPoisson, NegativeBinomialP, NegativeBinomial). Others do this in XYZResults.__init__ (e.g. DiscreteResults,MLEResults, LikelihoodModelResults, GLMResults). There aren't many Results subclasses (VARResults, SVARResults, VECMResults come to mind) that don't inherit from LikelihoodModelResults, so that covers most everything.

So the question is: why do some models call get_robustcov_results in fit?

Activity

  1. josef-pkt commented on Oct 12, 2017

    @josef-pkt
    Member

    Can you put those review comments in a SUMM issue?

    summary: I don't remember.
    At some point NegativeBinomial needed special treatment, but I don't remember if that is still necessary. The new count models were written by Evgeny during GSOC following the pattern in NegativeBinomial. Cov_type in zero-inflated is not yet "supported", no unit tests yet, and I don't remember if I checked those. However, I expect that they work in the same way as the old NegativeBinomial.

    As I mentioned before, cov_type needs another round of refactorings and enhancements, although I was thinking less of model specific cleanup and more of making the generic code more flexible to handle weights correctly. I need a day or three to think my way through the generic and the special cases again.

    NegativeBinomial.fit has this comment

            # Note: don't let super handle robust covariance because it has
            # transformed params
    

    I don't know if this is still applicable, but I recently opened other issues about problems in transformed params handling. Fixing some of those might make, or have made, the special case handling obsolete.

    The generic cov_type support is only tested for linear regression, discrete models and OLS, and I checked GenericLikelihoodModel. Others work if they support the same interface, but might raise somewhere, if not.

    (Aside: The main new use case for the new count models is predict. Those models need a correctly specified likelihood. So QMLE/cov_type for misspecified models is not as useful there as it is for the linear exponential family models like GLM, Logit, Poisson, one of the negbin, ...,)
    (As justification why I spend a lot of time reviewing and fixing/finishing predict, and didn't pay a lot of attention to cov_type in those models.)

  2. jbrockmendel commented on Oct 12, 2017

    @jbrockmendel
    ContributorAuthor

    Can you put those review comments in a SUMM issue?

    Sure. Maybe an Internal Consistency Topic Week?

    BTW I tried getting rid of the calls to get_robust_cov in fit and added the relevant kwargs to the Results(...) constructor calls. Tentatively looks OK.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions