Skip to content

ENH/REF/Design: review delegation in models with submodels, e.g. zero-inflated #7627

Open

Description

@josef-pkt

specific part of two- or multi-part models based on full submodel instances

Zero inflated models have two submodels, one for zero inflation and one for the main count model.
Much of the details can be delegated to the submodels.

I never reviewed specifically this delegation.

e.g. why does zeroinflated have a _hessian_logit and does not delegate to submodel hessian?

current issue (why I'm looking at it is) formula support

  • GenericZeroInflated.__init__ delegates to super for exog handling and not directly to submodels
  • no specific from_formula method which could delegate formula handling to submodels.
  • predict uses submodel predict methods and would include formula transform if supported.
    However, some of the extra prediction which need more than submodel predict and might not work without explicit ndarray exog.

other issues

  • what extra methods to we need in submodels to make delegation easier
    • predict temporarily replaces endog exog of submodel to compute loglikeobs for new, out-of-sample data
    • What do we need to support variable addition score tests for submodel exog? score_factor, hessian_factor?
  • (for later) fit_constrained transformation could be done on submodel exog. But that is more complicated because we need a new two-part model with replaced submodels with adjusted exogs and offsets.

Related: This is in contrast to two part models that do not use submodels, e.g. Beta regression has only one model but two link functions.

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