Repository navigation
ENH: add NegativeBinomial-P rebased - #3874
Conversation
|
This pull request introduces 3 alerts - view on lgtm.com new alerts:
Comment posted by lgtm.com |
|
doc build on travis fails, but it also failed in master after adding just a csv file and no changes to code https://travis-ci.org/statsmodels/statsmodels/builds/265820201 |
josef-pkt
left a comment
There was a problem hiding this comment.
more docstring changes
rest maybe in follow-up with margins unit test
| def fit_regularized(self, start_params=None, method='l1', | ||
| maxiter='defined_by_method', full_output=1, disp=1, callback=None, | ||
| alpha=0, trim_mode='auto', auto_trim_tol=0.01, size_trim_tol=1e-4, | ||
| qc_tol=0.03, **kwargs): |
There was a problem hiding this comment.
this should get a generic docstring
| def score(self, params): | ||
| """ | ||
| Generalized Negative Binomial (NB-P) model score (gradient) | ||
| vector of the log-likelihood |
There was a problem hiding this comment.
summary line should be one line
|
|
||
| for i in range(dim): | ||
| for j in range(i, -1, -1): | ||
| hess_arr[i, j] = np.sum(self.exog[:, i] * self.exog[:, j] * coeff) |
There was a problem hiding this comment.
we can avoid loop for this
| ((1 + a4) * (1 - a3 / a2) / a2 - | ||
| p * (np.log(a1 / a2) - digamma(a1) + digamma(a3) + 2) / mu + | ||
| p * (a3 / mu + a4) / a2 + | ||
| a4 * (polygamma(1, a1) - polygamma(1, a3))) / alpha).sum() |
There was a problem hiding this comment.
I guess this loop can also be vectorized
| def fit(self, start_params=None, method='bfgs', maxiter=35, | ||
| full_output=1, disp=1, callback=None, use_transparams = False, | ||
| cov_type='nonrobust', cov_kwds=None, use_t=None, **kwargs): | ||
|
|
There was a problem hiding this comment.
docstring missing, generic ?
|
@evgenyzhurko I just pushed an update including the cherry-pick of your last commit. One substantial change is in the default I added the margins test corresponding to NB2, and they pass without changes for p=2. I will merge when it is green, so you can reuse it in other branches after rebasing on master, but there are a few doc and style changes left for a follow-up. |
|
This pull request introduces 3 alerts - view on lgtm.com new alerts:
Comment posted by lgtm.com |
|
green (except for ARIMA appveyor failure) merging |
this is currently just a rebase of #3832