[Scipy-tickets] [SciPy] #1633: special.chndtrix (ncx2.ppf) gives wrong results (was: ncx2.ppf gives wrong results)

SciPy Trac scipy-tickets@scipy....
Mon Mar 26 18:34:49 CDT 2012


#1633: special.chndtrix  (ncx2.ppf) gives wrong results
---------------------------+------------------------------------------------
 Reporter:  pwei           |       Owner:  pv         
     Type:  defect         |      Status:  new        
 Priority:  normal         |   Milestone:  Unscheduled
Component:  scipy.special  |     Version:  0.9.0      
 Keywords:                 |  
---------------------------+------------------------------------------------
Changes (by josefpktd):

  * owner:  somebody => pv
  * component:  Other => scipy.special


Comment:

 Thanks for reporting.

 ncx2.ppf uses special.chndtrix

 chndtrix start to break down around 1.-1e-6

 {{{
     def _ppf(self, q, df, nc):
         return special.chndtrix(q,df,nc)
 }}}

 {{{
 >>> special.chndtrix(1.-2e-6,3,np.arange(20.)+1e-6)
 array([  2.92336811e+001,   3.57874861e+001,   4.22071558e+001,
          4.46824838e+001,   5.03059123e+001,   5.08927855e+001,
          5.43021864e+001,   5.76948044e+001,   6.10437535e+001,
          6.42841996e+001,   6.73216451e+001,   7.00658682e+001,
          7.24827273e+001,   7.46148566e+001,   1.00000000e+100,
          1.00000000e+100,   1.00000000e+100,   1.00000000e+100,
          1.00000000e+100,   1.00000000e+100])

 >>> special.chndtrix(1.-1e-6,3,np.arange(20.)+1e-6)
 array([  3.06648599e+001,   3.75158812e+001,   1.00000000e+100,
          4.77971746e+001,   1.00000000e+100,   5.37567615e+001,
          5.83848166e+001,   6.53758849e+001,   1.00000000e+100,
          1.00000000e+100,   1.00000000e+100,   1.00000000e+100,
          1.00000000e+100,   1.00000000e+100,   1.00000000e+100,
          1.00000000e+100,   1.00000000e+100,   1.00000000e+100,
          1.00000000e+100,   1.00000000e+100])

 >>> special.chndtrix(1.-1e-6,2,np.arange(20.)+1e-6)
 array([  2.76310349e+001,   3.54068314e+001,   1.00000000e+100,
          4.59771154e+001,   1.00000000e+100,   5.20675090e+001,
          5.67261071e+001,   6.37267444e+001,   1.00000000e+100,
          1.00000000e+100,   1.00000000e+100,   1.00000000e+100,
          1.00000000e+100,   1.00000000e+100,   1.00000000e+100,
          1.00000000e+100,   1.00000000e+100,   1.00000000e+100,
          1.00000000e+100,   1.00000000e+100])
 }}}

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


More information about the Scipy-tickets mailing list