Ticket #161 (closed defect: fixed)

Opened 2 months ago

Last modified 2 months ago

Kendall tau

Reported by: willaume@phimeca.com Assigned to: lapointe@phimeca.com
Priority: unspecified Milestone: not defined
Component: general Version: 0.12.1
Keywords: Cc:

Description

I compare the computeKendallTau method available for NumericalSample and the Kendalltau function available in scipy.stats.stats on the numerical sample :

RpE=NumericalSample(10,2)
RpE[0][0]=4
RpE[1][0]=10
RpE[2][0]=3
RpE[3][0]=1
RpE[4][0]=9
RpE[5][0]=2
RpE[6][0]=6
RpE[7][0]=7
RpE[8][0]=8
RpE[9][0]=5
RpE[0][1]=5
RpE[1][1]=8
RpE[2][1]=6
RpE[3][1]=2
RpE[4][1]=10
RpE[5][1]=3
RpE[6][1]=9
RpE[7][1]=4
RpE[8][1]=7
RpE[9][1]=1

Open TURNS returns me

Kendall Tau class=CorrelationMatrix dimension=2 implementation=class=MatrixImplementation name=Unnamed rows=2 columns=2 values=[1,0.418182,0.418182,1]

and the function

0.511111111111

Am I calculating the same thing ? Why is there a difference ?

Change History

11/06/08 17:14:41 changed by dutka

  • status changed from new to closed.
  • resolution set to invalid.

It seems to me that your question would have been better posted in ot-user mailing list. You will find there a bunch of users that may help you for this kind of problem.

Posting a bug, like this, ask the developers to solve your problem. I would have thought this is a mistake, but you posted many questions in the last days this way I think this is a misunderstanding of the bug tracker usage.

So let me tell you the right way to use this tool:

  1. if you have a question, ask the other users by posting it to the ot-user mailing list. You will have some answer a few days later. If not, try again.
  2. if the answer you got tells you that this is a bug, then before opening a new ticket (I'm sure you know how to do), check that there is no previous one with the same bug.
  3. if the software obviously behaves incorrectly (crash, error message asking for bug report, etc.), open a new ticket if there is no previous one.
  4. when opening a ticket, add a test script so we can reproduce the erroneous behavior.

Now I'm sure you understand why I close this ticket as invalid.

Ivan

PS : Did you post a bug in scipy too ?

11/06/08 17:18:47 changed by dutka

As a complement, see the GettingHelp page.

11/07/08 23:35:24 changed by regis.lebrun@eads.net

  • status changed from closed to reopened.
  • resolution deleted.

I have seen the message on the mailing list, and it appears to be an actual bug, so I reopen the ticket.

Régis

11/07/08 23:36:15 changed by regis.lebrun@eads.net

  • status changed from reopened to closed.
  • resolution set to fixed.

The bug is due to a factor n(n+1) instead of n(n-1) in the denominator of the tau statistics. I fixed it in my branch.

Note that OpenTURNS implementation of Kendall's tau does not integrate any correction for ties now, which can explains some differences with other statistical packages.

I checked with R that the results are now correct on your specific example (using the Kendall package).

Régis