Skip to content

ENH: Use GLM to get starting values for GEE - #5440

Merged
kshedden merged 2 commits into
statsmodels:masterfrom
kshedden:gee-start
Feb 3, 2019
Merged

kshedden merged 2 commits into
statsmodels:masterfrom
kshedden:gee-start

Conversation

@kshedden

@kshedden kshedden commented Jan 2, 2019

Copy link
Copy Markdown
Contributor

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(...).

@coveralls

coveralls commented Jan 2, 2019 •

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.0005%) to 84.497% when pulling 886018c on kshedden:gee-start into 91d71c6 on statsmodels:master.

@codecov

codecov Bot commented Jan 2, 2019 •

Copy link
Copy Markdown

Codecov Report

Merging #5440 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
...smodels/genmod/generalized_estimating_equations.py 83.1% <100%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 91d71c6...886018c. Read the comment docs.

@codecov

codecov Bot commented Jan 2, 2019

Copy link
Copy Markdown

Codecov Report

Merging #5440 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
...smodels/genmod/generalized_estimating_equations.py 83.1% <100%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e1fa491...7887f7a. Read the comment docs.

# 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)

@thequackdaddy thequackdaddy Jan 3, 2019 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@kshedden
kshedden merged commit 0558e51 into statsmodels:master Feb 3, 2019
@josef-pkt josef-pkt added this to the 0.10 milestone Apr 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants