Class CorrelationCoefficients
java.lang.Object
org.openjump.core.attributeoperations.statistics.CorrelationCoefficients
Class that calculates various correlation coefficients.
- Version:
- $Rev: 2509 $ modified: [sstein]: 16.Feb.2009 changed logger-entries to comments
- Author:
- Ole Rahn
FH Osnabrück - University of Applied Sciences Osnabrück,
Project: PIROL (2005),
Subproject: Daten- und Wissensmanagement
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclassprotected class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected doublearitmeticMiddle(Feature[] features, int attr) static doublegetDeviation(Feature[] features, String attr, double mean) Returns the deviation of the values of the given attribute."Spearman Rank Order Correlations (or "rho") and Kendall's Tau-b (or "tau") Correlations are used when the variables are measured as ranks (from highest-to-lowest or lowest-to-highest)"
http://www.themeasurementgroup.com/datamining/definitions/correlation.htmdoublegetMean(int nr) Get the aritmetic middle for the nr-th attribut givenget Pearson's correlation coefficient (good, dimension-less measure, if there is a linear relation between the attributes)
see: http://www.netzwelt.de/lexikon/Korrelationskoeffizient.htmlgetRank2SpearmanRankMap(Object[] sortedValues, HashMap<Object, Integer> value2NumAppearances) get Pearson's correlation coefficient (good, dimension-less measure, if there is a linear relation between the attributes)
see: http://www.netzwelt.de/lexikon/Korrelationskoeffizient.htmlprotected doublegetVariance(String attr) protected CorrelationDataPair[]initializeDataStorage(Feature[] features)
-
Field Details
-
dataArray
-
attrName1
-
attrName2
-
means
protected double[] means -
rawFeatures
-
-
Constructor Details
-
CorrelationCoefficients
-
-
Method Details
-
initializeDataStorage
-
getDeviation
Returns the deviation of the values of the given attribute. Uses a given mean to avoid multiple calculation of the mean. To get the mean take a look at the FeatureCollectionTools class. This class is also used by aritmeticMiddle().- Parameters:
features- array containing the features we want the deviation forattr- name of the attribute to calculate the deviation formean- the mean for the given features- Returns:
- the deviation
- Throws:
IllegalArgumentException- if the attribute is not of a numerical type- See Also:
-
getVariance
-
aritmeticMiddle
-
getMean
public double getMean(int nr) Get the aritmetic middle for the nr-th attribut given- Parameters:
nr- index number of attribut to calculate the mean for- Returns:
- the mean for the attribute or Double.NaN, if errors occured
-
getPearsonCoefficient
get Pearson's correlation coefficient (good, dimension-less measure, if there is a linear relation between the attributes)
see: http://www.netzwelt.de/lexikon/Korrelationskoeffizient.html- Returns:
- Pearson's correlation coefficient
-
getRank2SpearmanRankMap
-
getSpearmansRhoCoefficient
get Pearson's correlation coefficient (good, dimension-less measure, if there is a linear relation between the attributes)
see: http://www.netzwelt.de/lexikon/Korrelationskoeffizient.html- Returns:
- Pearson's correlation coefficient
-
getKendalsTauRankCoefficient
"Spearman Rank Order Correlations (or "rho") and Kendall's Tau-b (or "tau") Correlations are used when the variables are measured as ranks (from highest-to-lowest or lowest-to-highest)"
http://www.themeasurementgroup.com/datamining/definitions/correlation.htm- Returns:
- RankCorrelationInformation
-