[Scipy-tickets] [SciPy] #1690: scipy.stats.kendalltau: division by zero error

SciPy Trac scipy-tickets@scipy....
Sun Jul 15 16:59:41 CDT 2012

#1690: scipy.stats.kendalltau: division by zero error
 Reporter:  marek        |       Owner:  somebody      
     Type:  defect       |      Status:  needs_decision
 Priority:  normal       |   Milestone:  Unscheduled   
Component:  scipy.stats  |     Version:  0.10.0        
 Keywords:               |  

Comment(by josefpktd):

 I have preference for keeping the nans. pearsonr (np.corrcoef), and
 spearmanr also return nan if there is an array with zero variance. Stata
 also returns nan with it (Stata still shows a p-value=1 even if kendall-
 tau-a is nan).

 Also, since we just moved to nan with ttests, I think following the
 pattern of not guessing is preferable.

 Even for the current all ties case, I would prefer nan as in stata and R's

 On the other hand (1,1) as in package Kendall is nicely ambiguous,
 correlation is 1, but we don't reject the null hypothesis of independence
 with a huge p-value. (takes a while to figure out what it's supposed to

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

More information about the Scipy-tickets mailing list