Skip to content

VAR: print statements and plots #136

Open

Description

@josef-pkt

Trying out some examples (following some pandas examples form a notebook by Wes):

In python I don't expect an assignment to print anything, unless it's a warning.
Also, I would expect a test to return a numerical result.

>>> c = res.test_causality('m1', 'realgdp')
Granger causality f-test
=============================================================
   Test statistic   Critical Value          p-value        df
-------------------------------------------------------------
         1.110648         3.011286            0.330  (2, 579)
=============================================================
H_0: ['realgdp'] do not Granger-cause m1
Conclusion: fail to reject H_0 at 5.00% significance level

>>> res.test_whiteness()
FAIL: Some autocorrelations exceed 0.1414 bound. See plot
>>> w = res.test_whiteness()
FAIL: Some autocorrelations exceed 0.1414 bound. See plot

Activity

  1. wesm commented on Jan 11, 2012

    @wesm
    Member

    These tests should return little XTestResult classes

  2. josef-pkt commented on Jan 11, 2012

    @josef-pkt
    MemberAuthor

    Since this will be related: current test result class (for f_test, t_test) looks "ugly"

    >>> results.t_test(np.eye(4))
    <scikits.statsmodels.stats.contrast.ContrastResults object at 0x04DC7070>
    >>> print results.t_test(np.eye(4))
    <T test: effect=array([  0.7156402 ,   1.29528612,  -0.15212252, -39.91967442]), sd=array([  0.13485819,   0.36802427,   0.15629404,  11.89599685]), t=array([ 5.30661301,  3.51956718, -0.97330977, -3.35572335]), p=array([  2.89951236e-05,   1.31502720e-03,   1.72023048e-01,
             1.87515342e-03]), df_denom=17>
    
  3. wesm commented on Jan 11, 2012

    @wesm
    Member

    Yeah, those should all print pretty tables when repr'd in IPython

  4. jseabold commented on May 5, 2013

    @jseabold
    Member

    Should we set verbose = False for these by default? The ability to print doesn't bother me really, but maybe it shouldn't happen automatically.

  5. josef-pkt commented on May 5, 2013

    @josef-pkt
    MemberAuthor

    verbose=False should in general be the default, or never printing at all.

    best would be to replace results dictionary with a Bunch, so dictionary access is still available, and it doesn't break backwards compatibility. and use str == summary

    otherwise just add summary to the result dict, so users still can print even if verbose=False

  6. jseabold commented on May 5, 2013

    @jseabold
    Member

    Just doing VAR right now. I'll set verbose=False. I'll leave best/enhancements for when we have a general solution for all of these.

  7. added a commit that references this issue on Sep 26, 2014
    285bdf0
  8. added a commit that references this issue on Jun 17, 2016
    912babc
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions