You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compared to several other packages, sklearn for example, our documentation is still too much "library" style (like numpy, scipy)
see issue #635 for some discussion and suggestions
Currently, we have very few pages that present and compare different estimators that solve a similar problems. We have some of it in the examples that Vincent rewrote (e.g. OLS versus GLS versus RLM), and there are some overview pages (my diagnostic tests summary which is rather deep down in the toc tree.)
scikit-learn has overview pages also as module docstring (AFAICS), however this would not be useful for us to compare linear model versus rlm, or discrete model versus glm.
some of it could be done by expanding the examples and add more structure on top of it.
What would also be useful is a structured cross-index by statistical task or data. This should just be a commented index without duplicating much of the information.
Good example is also the UCLA index, examples and FAQ.
examples:
binary data: discrete Logit, Probit, GLM several links
time series prediction: ?
linear model and assumptions (more like the econometrics textbook structure plus RLM)
categorical analysis : now covered with examples
This should also link to relevant statistical tests and graphics.
(It would also help to identify gaps in what we have.)
Similar, I floated once the idea of a FAQ in the documentation, but nothing has happened yet. (and we don't get many faq's)
Caveat:
Sounds like a lot more work than current manpower, and will also be work to keep maintained and updated.
I actually don't think that the documentation has to include much of the OLSvsRLMvsWLS type of stuff. As the examples you gave suggest, there is already a lot of that kind of material elsewhere on web, not to mention econometrics/stats textbooks. The statistical interpretation of WLS coefficients is independent of the software implementation, and these techniques are old/famous enough that there's no realistic chance that statsmodels will produce (and maintain!) tutorials of a quality that beats what's already out there.
In the sk-learn case, a lot of the algorithms seem pretty new (or at least they target an audience that may be new to them), such that it's worth having lengthy tutorials that discuss the underlying theory and give practical examples. I think statsmodels is different.
Maybe I'm reading too much into my own experience here, but my sense is that the main stumbling block for adoption of statsmodels is more mechanical/process related. So the examples have a different purpose: showing how users can take data they have, use patsy to get the design matrix, and then print out a nice summary of results for their chosen estimation technique. They can then look up one of the thousands of websites on RLM if they want to understand what the deal is.
Exactly that has been my opinion so far, and it has been the reason I have felt that it's less urgent too add the "intro to statistics and econometrics" explanations.
I still don't think we need to write statistics tutorials (unless we get one if someone is using it for teaching).
However, I do think now that we need more "guided tours" across the module structure. The examples are a large part of it but may not be enough anymore, or much longer.
My thinking:
widening audience:
From stackoverflow and other "forums", I'm getting the impression that we start to get users without a large statistics background, who need to know what's available, and where to look for background information (e.g. Wikipedia and follow the links there, ...)
users and widening scope of statsmodels:
Even for users and developers with statistics or econometrics background, we start to have models and supporting tests, graphics, ..., that are not part of everyone's curriculum.
(RLM and GLM were unfamiliar to me before I started with stats.models. Sandwich robust covariance estimation might be pretty unfamiliar outside of social sciences. Nonparametrics and empirical likelihood will also be unfamiliar territory for most.)
It can be useful to point users into a direction where they wouldn't have looked based on the prior information.
widening scope and "What do we have?" and "Where's that function?"
FAQ: What can I use for outlier detection?
or listing together what's in the model sub-packages, graphics and statsmodels.stats available for a specific estimation and testing problem.
Except for the big models, I'm also starting to forget what's available and where it is.
(And once we find it, we might have to clean it up, and review the API of it.)
This still goes mostly to your last part, show what's available in statsmodels and how to use it.
I think we need to move in this direction, not that we will or have to get there very fast.
Maybe the best way to go about this is to create a wiki page to list everything that's available under different subcategories. Once everyone's pitched in, I could turn this into a more doc page.
Yes similar: for the topics we cover, and on a bit lower level with a list of specific functions/models.
I cannot find a good example right now. On the web (UCLA stats ?) there are some good topic introductions, that for example for SAS, list the different procedures that can be used for the analysis. Often it goes than over several procedures (same in Stata, and detailed parts of R's Task View) and lists or illustrates what the differences are.
as an example: coverage for large parts in the examples is pretty good, but it's mostly oriented towards modules
example_discrete and example_glm are both oriented towards introducing the model classes/estimation method.
Both cover binary models, discrete has margins, glm has more residual analysis and plots. I don't know if we have anything for specification tests.
Both examples also cover count regression.
Instead (or as additional structure) we could organize by topic, one binary, one count page, both plus graphics and specification tests (if or when they are available).
And if there are competing models some references or tests for choosing one or the other. And make notes when we are missing something.
Aside: I just realized: I think I never looked at a specification test when Logit and Probit and some competing GLM models are the choices. Can we use a generic test, or should there be a specific test?
Same question: How do you choose between different count models, especially in the cases when they are not nested? And which models (after the NBinom merge) do have a nested parameterization, where we can just use an LR test?
To continue the example: Binary or Count data
sections:
exploratory data analysis (EDA): maybe not much, refer to or leave it to pandas?, some plotting ?
available models for estimation, discrete, glm
post-estimation:
tests within or for the estimated model, parameters, goodness-of-fit, ... ?
interpretation: margins, effect sizes
graphical analysis of estimation results
specification tests:
assumptions of models
tests between competing models
prediction (if applicable or available)
I don't think duplicating the examples is useful, more an annotated table of content, similar in style to R's TaskView but narrower topic.
Another thought related to R: several of the task views are scientific field specific, several R packages are largely repackaging of methods in other packages or in standard R for a field specific target group.
At some point it will be useful to start to collect information about what parts of statsmodels could be useful in different fields:
" and statsmodels"
Plug in the where python has a foothold, and where there exists some
"Python in " to cover the non-statistic part.
Another thought related to R: several of the task views are scientific field specific, several R packages are largely repackaging of methods in other packages or in standard R for a field specific target group.
At some point it will be useful to start to collect information about what parts of statsmodels could be useful in different fields:
" and statsmodels"
Plug in the where python has a foothold, and where there exists some
"Python in " to cover the non-statistic part.
(more wishful thinking)
I like that idea.
Also the plan to more organize examples around / by use cases instead of API. (for this still the reference section is there).
—
Reply to this email directly or view it on GitHub.
Activity
vincentarelbundock commentedon Feb 7, 2013
My 2cents:
I actually don't think that the documentation has to include much of the OLSvsRLMvsWLS type of stuff. As the examples you gave suggest, there is already a lot of that kind of material elsewhere on web, not to mention econometrics/stats textbooks. The statistical interpretation of WLS coefficients is independent of the software implementation, and these techniques are old/famous enough that there's no realistic chance that statsmodels will produce (and maintain!) tutorials of a quality that beats what's already out there.
In the sk-learn case, a lot of the algorithms seem pretty new (or at least they target an audience that may be new to them), such that it's worth having lengthy tutorials that discuss the underlying theory and give practical examples. I think statsmodels is different.
Maybe I'm reading too much into my own experience here, but my sense is that the main stumbling block for adoption of statsmodels is more mechanical/process related. So the examples have a different purpose: showing how users can take data they have, use patsy to get the design matrix, and then print out a nice summary of results for their chosen estimation technique. They can then look up one of the thousands of websites on RLM if they want to understand what the deal is.
josef-pkt commentedon Feb 7, 2013
Exactly that has been my opinion so far, and it has been the reason I have felt that it's less urgent too add the "intro to statistics and econometrics" explanations.
I still don't think we need to write statistics tutorials (unless we get one if someone is using it for teaching).
However, I do think now that we need more "guided tours" across the module structure. The examples are a large part of it but may not be enough anymore, or much longer.
My thinking:
widening audience:
From stackoverflow and other "forums", I'm getting the impression that we start to get users without a large statistics background, who need to know what's available, and where to look for background information (e.g. Wikipedia and follow the links there, ...)
users and widening scope of statsmodels:
Even for users and developers with statistics or econometrics background, we start to have models and supporting tests, graphics, ..., that are not part of everyone's curriculum.
(RLM and GLM were unfamiliar to me before I started with stats.models. Sandwich robust covariance estimation might be pretty unfamiliar outside of social sciences. Nonparametrics and empirical likelihood will also be unfamiliar territory for most.)
It can be useful to point users into a direction where they wouldn't have looked based on the prior information.
widening scope and "What do we have?" and "Where's that function?"
FAQ: What can I use for outlier detection?
or listing together what's in the model sub-packages, graphics and statsmodels.stats available for a specific estimation and testing problem.
Except for the big models, I'm also starting to forget what's available and where it is.
(And once we find it, we might have to clean it up, and review the API of it.)
This still goes mostly to your last part, show what's available in statsmodels and how to use it.
I think we need to move in this direction, not that we will or have to get there very fast.
vincentarelbundock commentedon Feb 7, 2013
So it sounds like what we need is something akin to R's Task Views: http://cran.r-project.org/web/views/
Maybe the best way to go about this is to create a wiki page to list everything that's available under different subcategories. Once everyone's pitched in, I could turn this into a more doc page.
josef-pkt commentedon Feb 7, 2013
Yes similar: for the topics we cover, and on a bit lower level with a list of specific functions/models.
I cannot find a good example right now. On the web (UCLA stats ?) there are some good topic introductions, that for example for SAS, list the different procedures that can be used for the analysis. Often it goes than over several procedures (same in Stata, and detailed parts of R's Task View) and lists or illustrates what the differences are.
An index page http://www.ats.ucla.edu/stat/sas/topics/regression.htm because I don't find a good other page right now.
Or, for example, list the statsmodels equivalent of all functions that are mentioned on this page http://www.ats.ucla.edu/stat/sas/seminars/sas_repeatedmeasures/default.htm (since I looked at repeated measures a few days ago) or of the corresponding R or Stata version. (Not a good example, since we don't have it yet.)
We could start with a Wiki page, or/and a skeleton structure in the docs, and then add to it as possible,
and add the links to the actual docstrings and examples, or more detailed overview pages like http://statsmodels.sourceforge.net/devel/diagnostic.html
josef-pkt commentedon Feb 8, 2013
as an example: coverage for large parts in the examples is pretty good, but it's mostly oriented towards modules
example_discrete and example_glm are both oriented towards introducing the model classes/estimation method.
Both cover binary models, discrete has margins, glm has more residual analysis and plots. I don't know if we have anything for specification tests.
Both examples also cover count regression.
Instead (or as additional structure) we could organize by topic, one binary, one count page, both plus graphics and specification tests (if or when they are available).
And if there are competing models some references or tests for choosing one or the other. And make notes when we are missing something.
Aside: I just realized: I think I never looked at a specification test when Logit and Probit and some competing GLM models are the choices. Can we use a generic test, or should there be a specific test?
Same question: How do you choose between different count models, especially in the cases when they are not nested? And which models (after the NBinom merge) do have a nested parameterization, where we can just use an LR test?
To continue the example: Binary or Count data
sections:
I don't think duplicating the examples is useful, more an annotated table of content, similar in style to R's TaskView but narrower topic.
josef-pkt commentedon Feb 8, 2013
Another thought related to R: several of the task views are scientific field specific, several R packages are largely repackaging of methods in other packages or in standard R for a field specific target group.
At some point it will be useful to start to collect information about what parts of statsmodels could be useful in different fields:
" and statsmodels"
Plug in the where python has a foothold, and where there exists some
"Python in " to cover the non-statistic part.
(more wishful thinking)
dengemann commentedon Feb 8, 2013
On 08.02.2013, at 03:56, Josef Perktold [email protected] wrote:
I like that idea.
Also the plan to more organize examples around / by use cases instead of API. (for this still the reference section is there).
jseabold commentedon Apr 30, 2014
Partially (?) addressed by ea2e791