edu.iastate.metnet.metaomgraph
Class CorrelationCalc

java.lang.Object
  extended by edu.iastate.metnet.metaomgraph.CorrelationCalc

public class CorrelationCalc
extends java.lang.Object

Calculates Pearson Correlations for sets of data. Initialize it with data set A, and you can calculate P(A,B), P(A,C), etc. If you want to calculate P(B,C), you'll need to create a new calculator.

Author:
Nick Ransom

Constructor Summary
CorrelationCalc(double[] baseData)
          Constructs a correlation calculator for a given set of data
CorrelationCalc(java.lang.Number[] baseData)
          Constructs a correlation calculator for a given set of data
CorrelationCalc(java.lang.Object[] baseData)
          Constructs a correlation calculator for a given set of data.
 
Method Summary
 double oldPearsonCorrelation(double[] b)
          Calculates the Pearson Correlation of this calculator's base data with another set of data.
 double pearsonCorrelation(double[] b, boolean hasSkips, java.lang.Double blankValue)
           
 double pearsonCorrelation(java.lang.Object[] b, boolean hasSkips, java.lang.Double blankValue)
          Calculates the Pearson Correlation of this calculator's base data with another set of data.
 double pearsonCorrelationStandard(double[] b)
           
 double pearsonCorrelationWithSkips(double[] b, java.lang.Double blankValue)
           
 double spearmanCorrelation(double[] b, boolean hasSkips, java.lang.Double blankValue)
           
 double spearmanCorrelation(java.lang.Object[] b, boolean hasSkips, java.lang.Double blankValue)
          Calculates the Spearman Correlation of this calculator's base data with another set of data.
 double spearmanCorrelationStandard(double[] b)
          Calculates the Spearman Correlation of this calculator's base data with another set of data.
 double spearmanCorrelationWithReplacements(double[] b, java.lang.Double blankValue)
           
 double spearmanCorrelationWithSkips(double[] b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CorrelationCalc

public CorrelationCalc(double[] baseData)
Constructs a correlation calculator for a given set of data

Parameters:
baseData - Data against which everything will be compared

CorrelationCalc

public CorrelationCalc(java.lang.Number[] baseData)
Constructs a correlation calculator for a given set of data

Parameters:
baseData - Data against which everything will be compared

CorrelationCalc

public CorrelationCalc(java.lang.Object[] baseData)
Constructs a correlation calculator for a given set of data. Convenience constructor only, don't use it if you don't have to.

Parameters:
baseData - Data against which everything will be compared
Method Detail

pearsonCorrelation

public double pearsonCorrelation(java.lang.Object[] b,
                                 boolean hasSkips,
                                 java.lang.Double blankValue)
Calculates the Pearson Correlation of this calculator's base data with another set of data.

Parameters:
b - A set of data equal in length to the original base data set.
Returns:
The Pearson Correlation of this calculator's base data and the given data set.

pearsonCorrelation

public double pearsonCorrelation(double[] b,
                                 boolean hasSkips,
                                 java.lang.Double blankValue)

oldPearsonCorrelation

public double oldPearsonCorrelation(double[] b)
Calculates the Pearson Correlation of this calculator's base data with another set of data.

Parameters:
b - A set of data equal in length to the original base data set.
Returns:
The Pearson Correlation of this calculator's base data and the given data set.

pearsonCorrelationStandard

public double pearsonCorrelationStandard(double[] b)

pearsonCorrelationWithSkips

public double pearsonCorrelationWithSkips(double[] b,
                                          java.lang.Double blankValue)

spearmanCorrelationWithSkips

public double spearmanCorrelationWithSkips(double[] b)

spearmanCorrelationWithReplacements

public double spearmanCorrelationWithReplacements(double[] b,
                                                  java.lang.Double blankValue)

spearmanCorrelationStandard

public double spearmanCorrelationStandard(double[] b)
Calculates the Spearman Correlation of this calculator's base data with another set of data.

Parameters:
b - A set of data equal in length to the original base data set.
Returns:
The Spearman Correlation of this calculator's base data and the given data set.

spearmanCorrelation

public double spearmanCorrelation(double[] b,
                                  boolean hasSkips,
                                  java.lang.Double blankValue)

spearmanCorrelation

public double spearmanCorrelation(java.lang.Object[] b,
                                  boolean hasSkips,
                                  java.lang.Double blankValue)
Calculates the Spearman Correlation of this calculator's base data with another set of data.

Parameters:
b - A set of data equal in length to the original base data set.
Returns:
The Spearman Correlation of this calculator's base data and the given data set.