Repository navigation
Conversation
(possibly a problem with scale in Gaussian)
| special.gammaln(y + 1) - | ||
| special.gammaln(self.n - y + 1) + y * | ||
| np.log(mu/(1 - mu)) + self.n * | ||
| np.log(1 - mu)) |
There was a problem hiding this comment.
Is there some convention behind where line-breaks are in these expressions? My default is to base them on order-of-operations, so the last three lines would be split at the + instead of at the *. Not a big deal.
There was a problem hiding this comment.
The line breaks here look a bit unintuitive.
It's copy-paste here, and I don't know why the original has these breaks
Only official convention so far: readability in the eye of the developer and reviewer, with sometimes some usual or unusual reformatting by pep-8 tool
| log(scale) + scale*gammaln(1/scale)) | ||
| where gammaln is the log gamma function. | ||
| """ | ||
| return - 1./scale * (endog/mu + np.log(mu) + (scale - 1) * |
There was a problem hiding this comment.
More recent version simplifies some terms in here.
| if scale is None: | ||
| # This is just the loglikelihood for classical OLS | ||
| nobs = endog.shape[0] | ||
| ssr = ss(endog-self.fitted(mu)) |
There was a problem hiding this comment.
Looks like ss is scipy.stats. This is probably intended to be np.sum(endog - self.fitted(mu)**2, axis=0).
jbrockmendel
left a comment
There was a problem hiding this comment.
Implementing loglikeobs is a really good idea.
One thought that could trim the module down quite a bit is to have the Family class implement a default version of loglike that returns freq_weights.dot(self.loglikeobs(...))
|
loglikeobs versus loglike, and similar score_obs versus score: I thought about it but I'm usually conservative when coding keeping code duplication, then
generic models use automatic sum(xxx_obs), but not in core models. |
|
This shouldn't be that hard to pull over the finish line. The two cases that aren't obvious are
|
|
This is most likely obsolete when #3856 is merged |
|
Note the changes here are obsolet with merge of #3856 I keep this open for the second part of the title: MixedMixin. |
|
outdated but not obsolete there is no GLM.loglike_obs or GLM.loglikeobs discrete and my MixedMixin uses |
|
families now already have loglike_obs using mu as parameter It looks like we only need the GLM method with appropriate call to the family, the rest of this PR is obsolete. aside: We should deprecate loglikeobs where it already exists and use loglike_obs |
I have no idea what the status is or where the mixed mixin (from the branch title) is.
Just found this while browsing issues, open PR as reminder, not rebased
about MixedMixin, new module was not added to branch
"M:...\statsmodels_py34\statsmodels\base\mixed.py"
Modified Wednesday, May 6, 2015, 11:22:16 AM