Repository navigation
ENH: Use GLM to get starting values for GEE - #5440
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5440 +/- ##
==========================================
+ Coverage 81.99% 81.99% +<.01%
==========================================
Files 586 586
Lines 92275 92278 +3
Branches 10240 10240
==========================================
+ Hits 75660 75663 +3
Misses 14273 14273
Partials 2342 2342
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #5440 +/- ##
=========================================
+ Coverage 81.8% 81.8% +<.01%
=========================================
Files 574 574
Lines 90028 90031 +3
Branches 10027 10027
=========================================
+ Hits 73645 73648 +3
Misses 14116 14116
Partials 2267 2267
Continue to review full report at Codecov.
|
| # TODO: use GLM to get Poisson starting values | ||
| return np.zeros(self.exog.shape[1]) | ||
| model = GLM(self.endog, self.exog, family=self.family, | ||
| offset=self._offset_exposure, weights=self.weights) |
There was a problem hiding this comment.
Haven't verified this, but I don't think weights=self.weights does anything here.
Would it make sense to use freq_weights or var_weights instead? Using either will get you the same params. cov_params would be different, but I don't think you need that.
There was a problem hiding this comment.
Thanks, we should probably unify the notation so that GEE also uses freq_weights and var_weights. But for now I will just use freq_weights because I think that is what we have in GEE.
This resolves many of the convergence problems I have seen people encounter with GEE. Making it the default will avoid a lot of frustration. To get back the old behavior, just pass in
start_params = np.zeros(...).