avatarzhang / python-statlib

Automatically exported from code.google.com/p/python-statlib
Other
0 stars 0 forks source link

Compute the Spearman's rank correlation #3

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Compute the Spearman's rank correlation with the same list
2. Error divide by zero

What is the expected output? What do you see instead?
Change in line 921, in lspearmanr:
    t = rs * math.sqrt((n-2) / ((rs+1.0)*(1.0-rs)))
with:
    t = rs * math.sqrt((n-2) / ((rs+1.0+TINY)*(1.0-rs+TINY)))

Adding TINY you avoid once the correlation is perfect

What version of the product are you using? On what operating system?
- 1.1

Original issue reported on code.google.com by jas...@gmail.com on 31 Aug 2008 at 8:53

GoogleCodeExporter commented 8 years ago
thanks for reporting, fixed in trunk

Original comment by istvan.a...@gmail.com on 31 Aug 2008 at 11:06

GoogleCodeExporter commented 8 years ago
thanks to you, if I find something else I will report to you.

Original comment by jas...@gmail.com on 31 Aug 2008 at 11:38