Ich versuche Apache Commons Math's SpearmansCorrelation zu verwenden, aber ich habe einige Schwierigkeiten, wie ich nicht genug Hintergrund in Mathematik/Statistik habe.Apache Commons Math SpearmansCorrelation - Wie zu verwenden
Ich habe Spearman Rank Correlation recherchiert von:
- https://statistics.laerd.com/statistical-guides/spearmans-rank-order-correlation-statistical-guide-2.php
- http://geographyfieldwork.com/SpearmansRank.htm
ich die folgenden Beispiele gefunden haben:
- http://www.devdaily.com/java/jwarehouse/commons-math/src/main/java/org/apache/commons/math/stat/correlation/SpearmansCorrelation.java.shtml
- http://www.devdaily.com/java/jwarehouse/commons-math/src/test/java/org/apache/commons/math/stat/correlation/SpearmansRankCorrelationTest.java.shtml
- http://www.androidadb.com/class/na/NaturalRanking.html
würde Ich mag die Korrelation zwischen zwei Listen meiner Klasse berechnen:
public class TestClass{
int rank; // there may be two or more classes with the same rank - will need an averaging ties strategy
}
aus dem ich abgeleitet habe folgendes:
NaturalRanking naturalRanking = new NaturalRanking(NaNStrategy.FIXED,
TiesStrategy.AVERAGE);
RealMatrix dataMatrix= createRealMatrix(double[], int, int); // what do I need this matrix for and what parameters do I need to pass?
SpearmansCorrelation sc = SpearmansCorrelation(dataMatrix, naturalRanking);
sc.correlation(double[],double[]);// I have to convert my class into a list of doubles? How?