[Scipy-tickets] [SciPy] #1358: stats distributions discrete: problems at infinite upper bound

SciPy Trac scipy-tickets@scipy....
Sun May 8 21:58:55 CDT 2011


#1358: stats distributions discrete: problems at infinite upper bound
-------------------------+--------------------------------------------------
 Reporter:  josefpktd    |       Owner:  somebody    
     Type:  enhancement  |      Status:  needs_review
 Priority:  normal       |   Milestone:  0.10.0      
Component:  scipy.stats  |     Version:  0.8.0       
 Keywords:               |  
-------------------------+--------------------------------------------------
Changes (by JoshMGrant):

  * status:  new => needs_review
  * type:  defect => enhancement


Comment:

 Looking at the problem with stats.poisson.sf, it looks like the problem is
 in scipy.special.pdtr, and it runs into problems with inf. Could the code
 be changed to this:

 {{{
 double pdtrc( k, m )
 int k;
 double m;
 {
 double v;

 if( (k < 0) || (m <= 0.0) )
         {
         mtherr( "pdtrc", DOMAIN );
         return( NPY_NAN );
         }
 else if ( k > MAX_INT )
         {
         // if k is sufficiently large, the cdf is 1
         return 1.0;
         }
 v = k+1;
 return( igam( v, m ) );
 }
 }}}

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1358#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