You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Martin Rosellen <Ma...@fu-berlin.de> on 2012/12/13 15:57:55 UTC

[math] pearson and spearman correlation runtime complexity

Hi again,

I tried to implement the pearson and spearman algorithm myself and the 
computation took very long. That is why I now use the commons math 
solution. I am curious about the runtime complexity of the Pearson and 
the Spearman correlation coefficient. Can someone help me with that?

Greetz
Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [math] pearson and spearman correlation runtime complexity

Posted by Ted Dunning <te...@gmail.com>.
Can you say more about how you implemented these?

The Pearson coefficient should be quite simple.  A few passes through the
data should suffice and it can probably be done in one pass, especially if
you aren't worried about 1ULP accuracy.

The Spearman coefficient should be no worse than the cost of sorting plus
the cost of the Pearson computation.  There are often faster methods as
well if there are no ties.

On Thu, Dec 13, 2012 at 6:57 AM, Martin Rosellen <
Martin.Rosellen@fu-berlin.de> wrote:

> Hi again,
>
> I tried to implement the pearson and spearman algorithm myself and the
> computation took very long. That is why I now use the commons math
> solution. I am curious about the runtime complexity of the Pearson and the
> Spearman correlation coefficient. Can someone help me with that?
>
> Greetz
> Martin
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: dev-unsubscribe@commons.**apache.org<de...@commons.apache.org>
> For additional commands, e-mail: dev-help@commons.apache.org
>
>