Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 78667 invoked from network); 21 Jun 2009 02:22:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Jun 2009 02:22:22 -0000 Received: (qmail 85687 invoked by uid 500); 21 Jun 2009 02:22:32 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 85577 invoked by uid 500); 21 Jun 2009 02:22:32 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 85568 invoked by uid 99); 21 Jun 2009 02:22:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 21 Jun 2009 02:22:32 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 21 Jun 2009 02:22:30 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 3268223888A0; Sun, 21 Jun 2009 02:22:10 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r786940 - /commons/proper/math/trunk/src/site/xdoc/userguide/stat.xml Date: Sun, 21 Jun 2009 02:22:10 -0000 To: commits@commons.apache.org From: psteitz@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090621022210.3268223888A0@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: psteitz Date: Sun Jun 21 02:22:09 2009 New Revision: 786940 URL: http://svn.apache.org/viewvc?rev=786940&view=rev Log: Added Spearman's correlation. Modified: commons/proper/math/trunk/src/site/xdoc/userguide/stat.xml Modified: commons/proper/math/trunk/src/site/xdoc/userguide/stat.xml URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/site/xdoc/userguide/stat.xml?rev=786940&r1=786939&r2=786940&view=diff ============================================================================== --- commons/proper/math/trunk/src/site/xdoc/userguide/stat.xml (original) +++ commons/proper/math/trunk/src/site/xdoc/userguide/stat.xml Sun Jun 21 02:22:09 2009 @@ -543,9 +543,11 @@ org.apache.commons.math.stat.correlation package computes covariances and correlations for pairs of arrays or columns of a matrix. - Covariance computes covariances and + Covariance computes covariances, - PearsonsCorrelation provides Pearson's Product-Moment correlation coefficients. + PearsonsCorrelation provides Pearson's Product-Moment correlation coefficients and + + SpearmansCorrelation computes Spearman's rank correlation.

Implementation Notes @@ -560,12 +562,19 @@ defaults to true.

  • - + PearsonsCorrelation computes correlations defined by the formula

    cor(X, Y) = sum[(xi - E(X))(yi - E(Y))] / [(n - 1)s(X)s(Y)]
    where E(X) and E(Y) are means of X and Y and s(X), s(Y) are standard deviations.
  • +
  • + + SpearmansCorrelation applies a rank transformation to the input data and computes Pearson's + correlation on the ranked data. The ranking algorithm is configurable. By default, + + NaturalRanking with default strategies for handling ties and NaN values is used. +
  • @@ -657,6 +666,20 @@ between the two columns of data is significant at the 99% level.

    +

    Spearman's rank correlation coefficient
    +

    +
    To compute the Spearman's rank-moment correlation between two double arrays + x and y: + +new SpearmansCorrelation().correlation(x, y) + + This is equivalent to + +RankingAlgorithm ranking = new NaturalRanking(); +new PearsonsCorrelation().correlation(ranking.rank(x), ranking.rank(y)) + +
    +