Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc work GEE, GMM, sphinx warnings #1264

Merged
merged 4 commits into from Dec 24, 2013

Conversation

Projects
None yet
3 participants
@josef-pkt
Copy link
Member

commented Dec 22, 2013

add GEE to docs
improve GMM docs, add new classes

fix some spinx warnings
var_plots truncated year string
seealso VAR documentation gave invalid option block warning

I upgraded sphinx to version 1.2, I'm still not building notebooks and didn't check those.

GEE still needs proof reading and example in gee.rst
GMM and sandwich covariances still need improvements

@josef-pkt

This comment has been minimized.

Copy link
Member Author

commented Dec 22, 2013

I would like to merge this soon, because I want to go back to sandwiches, docs and wrapper function, as far as I find time.

@coveralls

This comment has been minimized.

Copy link

commented Dec 22, 2013

Coverage Status

Changes Unknown when pulling 011a445 on josef-pkt:doc_work into * on statsmodels:master*.

The base class for correlation and covariance structures of cluster data.
Each implementation of this class takes the residuals from a regression
model that has been fit to clustered data, and uses them to estimate the

This comment has been minimized.

Copy link
@vincentarelbundock
-------
**Attributes**
naive_covariance : ndarray

This comment has been minimized.

Copy link
@vincentarelbundock

vincentarelbundock Dec 22, 2013

Contributor

Not sure if we have a standard for this, but it would make sense to me to reverse these: "covariance_naive", "covariance_robust". That way, they would all show up together when using tab completion (which usually prints in alphabetical order).

Also, can "robust_covariance_bc" just be called "robust_covariance"?

Edit: OK, I see that there's a choice below between "robust" and "robust bias reduced"

This comment has been minimized.

Copy link
@josef-pkt

josef-pkt Dec 23, 2013

Author Member

I'll add this to the GEE-followup issue,
I also prefer post-fix qualifiers, covariance_xxx, resid_xxx
( how the robust cov are attached still needs to change to make t_test, wald_test work correctly)

Linear predicted values for the fitted model.
dot(exog, params)
model : class instance
Pointer to GLM model instance that called fit.

This comment has been minimized.

Copy link
@vincentarelbundock

vincentarelbundock Dec 22, 2013

Contributor

GLM -> GEE?

data.
scale : float
The estimate of the scale / dispersion for the model fit.
See GLM.fit and GLM.estimate_scale for more information.

This comment has been minimized.

Copy link
@vincentarelbundock

vincentarelbundock Dec 22, 2013

Contributor

GLM -> GEE

This comment has been minimized.

Copy link
@josef-pkt

josef-pkt Dec 23, 2013

Author Member

estimate_scale in GEE has different signature and pattern than in GLM, and no "more information" in docstring.

score_norm : float
norm of the score at the end of the iterative estimation.
stand_errors : array
The standard errors of the fitted GLM. #TODO still named bse

This comment has been minimized.

Copy link
@vincentarelbundock

vincentarelbundock Dec 22, 2013

Contributor

GLM -> GEE?

This comment has been minimized.

Copy link
@josef-pkt

josef-pkt Dec 23, 2013

Author Member

including stand_error here might be wrong, needs checking

This comment has been minimized.

Copy link
@josef-pkt

josef-pkt Dec 23, 2013

Author Member

change to bse which is still the inherited attribute

For estimation with more options use fititer method.
TODO: weight and covariance arguments still need to be made consistent

This comment has been minimized.

Copy link
@vincentarelbundock

vincentarelbundock Dec 22, 2013

Contributor

Comment out?

This comment has been minimized.

Copy link
@josef-pkt

josef-pkt Dec 23, 2013

Author Member

It's a warning that this will change, hopefully soon. based on changes to robust cov in RegressionResults

variables and `z` are the instruments. Variables in `x` that are exogenous
need also be included in `z`.
Notation Warning: our name `exog` stands for the explanatory variables,

This comment has been minimized.

Copy link
@vincentarelbundock

vincentarelbundock Dec 22, 2013

Contributor

awkward ;)

@josef-pkt

This comment has been minimized.

Copy link
Member Author

commented Dec 22, 2013

Thanks Vincent, I will make the changes soon.

exog is not exogenous is really a bit awkward, Right now it's the most convenient interface (for writing the code).
I think we should be able to use formulas.
And for now I didn't like the distinction between dependent endogenous, explanatory endogenous, included exogenous and excluded exogenous, similar to ivregress, ivreg2, since the code so far doesn't need it, and GMM might never need it.

Is the current docstring roughly understandable? They still needs improvements in many places, but I'd like to work on doc examples next to get a better view on what's awkward to use.

@vincentarelbundock

This comment has been minimized.

Copy link
Contributor

commented Dec 22, 2013

I think it sounds very good overall. I usually need to actually use something before I can tell for sure, but we can always improve them later on.

@josef-pkt

This comment has been minimized.

Copy link
Member Author

commented Dec 22, 2013

I have two gists for GMM that I need to update,
https://gist.github.com/josef-pkt/6895915
https://gist.github.com/josef-pkt/6890383

I used them as initial examples for the rewrite and unit tests.

What I already started to try out examples that compare models, like
GEE gaussian independence cluster is the same as OLS with cluster robust (up to small sample scale factors)
the same should work for Poisson and the other models
GEE gaussian exchangeable should be the same as SUR in balanced panel. (not tried yet)

I couldn't compare GEE with GMM because I don't have cluster robust standard errors yet in GMM.

@vincentarelbundock

This comment has been minimized.

Copy link
Contributor

commented Dec 22, 2013

The notebooks look nice. I could try to clean those up for you if you'd like.

Do you think we could use data from Rdatasets instead so we don't have to package more datasets with SM?

Tip: You can put equations inside dollar signs to have them render as latex in the notebooks. No need to indent or pretend they are code.

@josef-pkt

This comment has been minimized.

Copy link
Member Author

commented Dec 22, 2013

I'd like to update the code in the notebooks first, so I can see what changes I made compared to the original version.

Datasets are still an open question, there are some in the unit tests of GEE and GMM, but we should get some official datasets also in statmodels, that we can use for the panel/cluster, Statas x... functions.

For other documentation we can use Rdatasets, and I also started to look at some textbook datasets like those of the two Wooldridge books. UCLA stats and Boston have worked out examples for those and I started some preliminary work to "replicate".

I definitely need lots of tips for notebooks since I still don't use them very often.

@josef-pkt josef-pkt referenced this pull request Dec 23, 2013

Open

SUMM: GEE followup #1257

dot(exog, params)
model : class instance
Pointer to GLM model instance that called fit.
nobs : float

This comment has been minimized.

Copy link
@josef-pkt

josef-pkt Dec 23, 2013

Author Member

nobs is not available as attribute of results

@josef-pkt

This comment has been minimized.

Copy link
Member Author

commented Dec 23, 2013

made changes from Vincent's review, except naming convention (needs follow-up PR) and left TODO in gmm (needs followup code changes)

josef-pkt added a commit that referenced this pull request Dec 24, 2013

Merge pull request #1264 from josef-pkt/doc_work
Doc work GEE, GMM, sphinx warnings

@josef-pkt josef-pkt merged commit 8372093 into statsmodels:master Dec 24, 2013

@josef-pkt josef-pkt deleted the josef-pkt:doc_work branch Jul 10, 2014

PierreBdR pushed a commit to PierreBdR/statsmodels that referenced this pull request Sep 2, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.