You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will also apply to Tobit (and maybe ARIMA). I'm starting to like more that most options go into the Model instantiation and the fit methods are as uniform as possible. Could possible help in writing Pipeline-style code for bootstrapping etc. like scikit-learn, though I need to think more about whether and how it generalizes. Something like
class _NegativeBinomialBase(LikelihoodModel):
...
class NegativeBinomialNB1(_NegativeBinomialBase):
def loglike(self, params):
...
...
def NegativeBinomial(..., loglike_method="nb1"):
if loglike_method == "nb1":
return NegativeBinomialNB1(...)
Ok, something like this sounds simple enough. I thought about doing something like this before.
The only place I know where similar dispatch to subclasses occurs is in the scipy spline classes, and there I found it confusing when there are different methods and options.
But in our cases it might be understandable enough.
BTW: I created a linmod function once, that dispatched to OLS, WLS or GLS depending on the presence of keywords, weights and sigma.
I thought initially that you meant creating classes on the fly.
Nah, I don't think we would gain much from having any black magic here. Literally the only methods I can think to overwrite would be the loglike and hessian. Something like a linmod or LinearModel might be a nice entry-point too.
Activity
josef-pkt commentedon May 19, 2013
Ok, something like this sounds simple enough. I thought about doing something like this before.
The only place I know where similar dispatch to subclasses occurs is in the scipy spline classes, and there I found it confusing when there are different methods and options.
But in our cases it might be understandable enough.
BTW: I created a linmod function once, that dispatched to OLS, WLS or GLS depending on the presence of keywords, weights and sigma.
I thought initially that you meant creating classes on the fly.
jseabold commentedon May 19, 2013
Nah, I don't think we would gain much from having any black magic here. Literally the only methods I can think to overwrite would be the loglike and hessian. Something like a linmod or LinearModel might be a nice entry-point too.