[Scipy-tickets] [SciPy] #1676: Errors in t statistic , scipy.stats.test() fails due to assertion error

SciPy Trac scipy-tickets@scipy....
Wed Aug 1 08:53:36 CDT 2012


#1676: Errors in t statistic ,scipy.stats.test() fails due to assertion error
-------------------------------------+--------------------------------------
 Reporter:  blowthesax               |       Owner:  pv         
     Type:  defect                   |      Status:  new        
 Priority:  normal                   |   Milestone:  Unscheduled
Component:  scipy.special            |     Version:  0.10.0     
 Keywords:  t test, assertion error  |  
-------------------------------------+--------------------------------------
Changes (by mike.wimmer):

 * cc: mike.wimmer (added)


Comment:

 Replying to [comment:5 pv]:
 > Forwarded to Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=831686

 This is not specific to Fedora, I have experienced the same problem with
 Mac OSX, in combination with gcc & gfortran 4.7 (the latter is the
 important bit I believe).

 First of all, I find the same error in scipy.test() as the original
 poster, and I can also relate it to scipy.special.stdtr which gives me the
 same numbers (give or take the last few decimals) as discussed in the
 postings below.

 In fact it turns out to be a Fortran issue in some sort:
 scipy.special.stdtr does *not* call "stdtr" from cephes, but instead
 "cdft" from cdflib (sorry, but please delete cephes/stdtr.c in future
 releases if you do not use it - while debugging this issue this caused me
 quite some headaches).

 I could reproduce the issue in a small C-code snippet

 {{{
 #include <stdio.h>

 main() {
   double p, q;
   double df, t, bound;
   int status, which;

   df = 1000;
   t = 5;

   which = 1;

   cdft_(&which, &p, &q, &t, &df, &status, &bound);

   printf("%f\n", p);
 }

 }}}

 And linking that agains the cdflib as distributed by scipy.

 If I compile cdflib without optimization, I get the correct result (close
 to 1), with -O1 I suddenly get the wrong result also reported by scipy.

 Whether this is a genuine compiler bug or rather a bug in cdflib which
 only shows up in gfortran 4.7 I cannot say, nor will I investigate this
 further (I actually don't use that function, just was wondering about the
 failed test).

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1676#comment:6>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list