Skip to content

documentation: add topics/comparison pages #650

Open

Description

@josef-pkt

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.

Activity

  1. vincentarelbundock commented on Feb 7, 2013

    @vincentarelbundock

    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.

  2. josef-pkt commented on Feb 7, 2013

    @josef-pkt
    MemberAuthor

    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.

  3. vincentarelbundock commented on Feb 7, 2013

    @vincentarelbundock

    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.

  4. josef-pkt commented on Feb 7, 2013

    @josef-pkt
    MemberAuthor

    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

  5. josef-pkt commented on Feb 8, 2013

    @josef-pkt
    MemberAuthor

    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:

    1. exploratory data analysis (EDA): maybe not much, refer to or leave it to pandas?, some plotting ?
    2. available models for estimation, discrete, glm
    3. post-estimation:
      • tests within or for the estimated model, parameters, goodness-of-fit, ... ?
      • interpretation: margins, effect sizes
    4. graphical analysis of estimation results
    5. specification tests:
      • assumptions of models
      • tests between competing models
    6. 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.

  6. josef-pkt commented on Feb 8, 2013

    @josef-pkt
    MemberAuthor

    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)

  7. dengemann commented on Feb 8, 2013

    @dengemann
    Contributor

    On 08.02.2013, at 03:56, Josef Perktold [email protected] wrote:

    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.

  8. jseabold commented on Apr 30, 2014

    @jseabold
    Member

    Partially (?) addressed by ea2e791

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions