com.twitter.common.stats
Class Significance

java.lang.Object
  extended by com.twitter.common.stats.Significance

public class Significance
extends Object

Calculate significance scores between an observed amount and an expected amount.


Method Summary
static double chiSqrScore(double observed, double expected)
           
static double logLikelihood(double observed, double expected)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

chiSqrScore

public static double chiSqrScore(double observed,
                                 double expected)
Parameters:
observed - The observed amount.
expected - The expected amount.
Returns:
[(observed - expected) ** 2 / expected] * sign(observed - expected)

logLikelihood

public static double logLikelihood(double observed,
                                   double expected)
Parameters:
observed - The observed amount.
expected - The expected amount.
Returns:
-2 * expected * log(observed / expected) * sign(observed - expected)