Skip to content

Review changes to f_test and t_test #436

Open

Description

@josef-pkt

I just saw this and I don't know if I like it

c4b0c13

deprecating q_matrix
using patsy even if array ?

Activity

  1. jseabold commented on Aug 20, 2012

    @jseabold
    Member

    It's just a pass-through for array and makes it easier to support both ways of specifying the test without having a complicated signature. Users still never need to know about patsy under the hood.

  2. josef-pkt commented on Aug 20, 2012

    @josef-pkt
    MemberAuthor

    using patsy is another detour with imports and code that I don't need to know for the simple case.
    If it's just a pass-through, then it's better just to skip it ourselves.

    (I'm starting to think more that we need lm and lm.fit as separate objects as in R, if we make bootstrap and other loops expensive.)

    a few milliseconds and an extra import here and some there, and it starts to add up, I think.
    (bootstrap with f_test for RLM with LTS starting values and scale makes a few thousand calls to OLS and WLS ?)

    I'm not doing serious timing yet, but just want to avoid unnecessary cases and detours.

  3. jseabold commented on Aug 20, 2012

    @jseabold
    Member

    I agree in general, but this seems pretty harmless. Do you anticipate using f_test in a loop?

  4. josef-pkt commented on Aug 20, 2012

    @josef-pkt
    MemberAuthor

    I opened an issue because I haven't looked at it yet. (I'm late reviewing Alexandre's code and just wanted to compare terminology/names for restriction matrices.)

    I think it's likely we have t_test in a bootstrap loop, but I don't know about whether a f_test loop will be common.
    Come to think of it:
    Grangecausalitytests uses the f_test, also several of the other diagnostic tests use f_test.
    So bootstrap for those tests will require f_test for each bootstrap sample.

    There might be more permutation tests that might be easy to implement with OLS and also require f_test or t_test. Just guessing for the last part.

    For pass-throughs I worry more about import times and code readability.

  5. jseabold commented on Aug 20, 2012

    @jseabold
    Member

    Well imports only happen once, and I worry that special casing for when to use patsy would be just as heavy in a loop - since patsy does this check anyway. Mainly I got tired of discussing and coding around where certain packages end and others begin. Somewhat relatedly, I still think we can ship patsy since this code will hopefully be a slow-moving target.

  6. josef-pkt commented on Aug 20, 2012

    @josef-pkt
    MemberAuthor

    On windows imports happen once per process that is started, with multiprocessing/joblib.

    To the relately:
    If it's fast moving, we might have to ship it to keep a compatible version.
    Including patsy might also make it easier to get through the Linux distribution channels, although I don't know if that's really relevant.
    And, if L1 penalization/Lasso with Jonathan's code turns out to be successful, I thought, we could also include it in an external directory in the statsmodels distribution.

  7. josef-pkt commented on Oct 15, 2012

    @josef-pkt
    MemberAuthor

    Just saw this while checking sandbox example under python 3.2.3

    Traceback (most recent call last):
      File "E:\Josef\testing\tox\py323a\Lib\site-packages\statsmodels\sandbox\examples\ex_mixed_lls_re.py", line 152, in <module>
        print(res.t_test([1]))
      File "E:\Josef\testing\tox\py323a\lib\site-packages\statsmodels\base\model.py", line 1178, in t_test
        LC = DesignInfo(self.model.exog_names).linear_constraint(r_matrix)
    AttributeError: 'OneWayMixed' object has no attribute 'exog_names'
    
  8. josef-pkt commented on Feb 6, 2013

    @josef-pkt
    MemberAuthor

    I updated issue header, I was searching for this with term t_test

    I tried to see if it works (OneWayMixed), if we just delegate to pandas if r_matrix is a string. It works, but I'm not sure we handle all cases.

  9. josef-pkt commented on Aug 14, 2013

    @josef-pkt
    MemberAuthor

    Right now we have the requirement that exog_names have to be defined.

    Keeping this open as "design" issue, because I'm still not happy about it.

    same question when we get the normal or chisquare based Wald tests.

  10. josef-pkt commented on Sep 20, 2014

    @josef-pkt
    MemberAuthor

    postponed for another day.

    new SUMMary issue #1970

  11. modified the milestones: 0.7, 0.6 on Sep 20, 2014
  12. removed this from the 0.7 milestone on Feb 15, 2015
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