vincentarelbundock/pymarginaleffects

How to add support for a new model

saudiwin opened this issue ยท 4 comments

Hey Vincent, it's me, your favorite annoying American programmer!! ๐Ÿ˜…

As I mentioned on Twitter, I just came up with an MLE implementation of ordbetareg using scipy. Estimation of marginal effects with numerical differentiation should be straightforward as it's a standard MLE fit with Hessian, etc. However, there does not yet seem to a be a protocol for adding support for models to the pymarginaleffects package as there is with the R version. Any particular way you want me to go about doing this? I'm not an expert python programmer by any means, but chatGPT has proven to be remarkably helpful...

That looks great.

Would you want to define that as a general model class? I.e. if class = MarginalEffectsModel and all the methods are implemented, then it could pass the model sanity check.

Practically should I do a PR for this? I think it has to be within the codebase as I can't get around the model check otherwise.

Yes, it would need to be a class like ModelOrdBetaReg, which inherits from ModelAbstract, as in the example I showed you.

A PR would be great, because otherwise I probably won't have time to implement this in the near future.