Skip to content

SUMM: GEE followup #1257

Open
Open

Description

@josef-pkt

(an issue to collect possible or required changes to GEE, that should be reviewed after merge)

  • REF: GEE handling of default covariance matrices #1256 access to default covariance
  • bse is not defined (using default covariance), my mistake: bse is inherited
  • t_test requires df_resid which is not defined, use_t is also newer than GEE
  • add get_margeff to Results class, has only smoke test
  • raise exceptions for misspelled covariance_types (not done for argument in fit)
  • inherited attributes that are not available, needs overwriting llf see comment. (*)

(*) currently wrong inheritance, GEEResults is not a "LikelihoodModelResults", we still need a new baseclass (also for GMM, ...), llf based results are not available

naming convention

with new areas like robust covariances across models, we need to decide on a consistent naming scheme

cov_type, covariance_type, ...
covariance_robust robust_covariance, ... postfix qualifier see comment 1 in #1264

Activity

  1. josef-pkt commented on Dec 19, 2013

    @josef-pkt
    MemberAuthor

    Note: some of the above, wald_test, updated t_test, covariance_default, are not yet available in #1256 because it's newer in master

  2. josef-pkt commented on Dec 20, 2013

    @josef-pkt
    MemberAuthor

    differences in degrees of freedom, small sample correction

    GEE Gaussian Independence versus OLS with cluster robust covariances

    >>> md2cf.bse / res_ols_clu.bse
    array([ 0.99604385,  0.99604385,  0.99604385,  0.99604385,  0.99604385])
    >>> da.exog.shape
    (1375, 5)
    >>> (1375 - 5) / 1375.
    0.9963636363636363
    >>> md2cf.bse * 1375. / (1375 - 5)  -  res_ols_clu.bse
    array([ -3.38051374e-05,  -1.58580843e-05,  -1.86591806e-05,
            -1.80764859e-05,  -1.69451765e-05])
    

    add options or ignore? (Stata also has different correction factor for cluster robust after OLS and after Poisson)

  3. josef-pkt commented on Dec 20, 2013

    @josef-pkt
    MemberAuthor

    test failure on Debian #1260

  4. josef-pkt commented on Dec 23, 2013

    @josef-pkt
    MemberAuthor

    inherited attributes that are not available

    >>> md2cf.llf
    Traceback (most recent call last):
      File "<pyshell#75>", line 1, in <module>
        md2cf.llf
      File "e:\josef\eclipsegworkspace\statsmodels-git\statsmodels-all-new2_py27\statsmodels\statsmodels\tools\decorators.py", line 95, in __get__
        _cachedval = self.fget(obj)
      File "e:\josef\eclipsegworkspace\statsmodels-git\statsmodels-all-new2_py27\statsmodels\statsmodels\base\model.py", line 1168, in llf
        self.scale = scale
    AttributeError: 'GEE' object has no attribute 'loglike'
    

    edit llf is the only one that raises an exception

    md2cf is family gaussian result instance

    >>> len([getattr(md2cf, i) for i in dir(md2cf) if not i=='llf'])
    50
    
  5. josef-pkt commented on Dec 23, 2013

    @josef-pkt
    MemberAuthor

    general review across results

    GEEResults has
    k_constant not in docstring
    nobs not available but is in docstring copied from GLM, I removed it from GEEResults docstring

  6. josef-pkt commented on Apr 8, 2014

    @josef-pkt
    MemberAuthor

    playing with sparse matrices for covariance structures
    http://nbviewer.ipython.org/gist/josef-pkt/b66c9405a1593be1cbc9

    For at least the simple covariance structures, MDependent, AR it should be possible to use operations with full arrays and sparse matrices instead of the group loop. The possible performance advantage is if we can build most of the sparse structure at the initialize stage and have simpler vectorized operations (scipy.sparse C++) instead of looping over groups.
    We need more helper functions and experience to take advantage of sparse arrays, and check when it's really faster.

  7. josef-pkt commented on Aug 23, 2014

    @josef-pkt
    MemberAuthor

    several of the issues have been fixed in #1924

    see that PR for a summary and some items that are still open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions