org.eclipse.test.internal.performance.eval
Class StatisticsUtil

java.lang.Object
  extended by org.eclipse.test.internal.performance.eval.StatisticsUtil

public final class StatisticsUtil
extends java.lang.Object

Utility methods for statistics.

Since:
3.2

Nested Class Summary
static class StatisticsUtil.Percentile
          Percentile constants class.
 
Field Summary
static StatisticsUtil.Percentile T90
           
static StatisticsUtil.Percentile T95
           
static StatisticsUtil.Percentile T97_5
           
static StatisticsUtil.Percentile T99
           
 
Method Summary
static double deviation(double[] values)
           
static double getStudentsT(int df, StatisticsUtil.Percentile percentile)
          Returns the student's t value from the two-tailed t-table.
static double standardError(double[] values, double[] stddevs, long[] counts)
           
static double[] statisticsForTimeSeries(TimeSeries refSeries, int index1, TimeSeries testSeries, int index2, StatisticsUtil.Percentile percentile)
          Returns true if the mean of two data sets is significantly different, such that the probability that they are from the same population is lower than percentile, false otherwise.
static double studentTtest(double[] values, double[] stddevs, long[] counts, StatisticsUtil.Percentile percentile)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

T90

public static final StatisticsUtil.Percentile T90

T95

public static final StatisticsUtil.Percentile T95

T97_5

public static final StatisticsUtil.Percentile T97_5

T99

public static final StatisticsUtil.Percentile T99
Method Detail

getStudentsT

public static double getStudentsT(int df,
                                  StatisticsUtil.Percentile percentile)
Returns the student's t value from the two-tailed t-table. For a degree-of-freedom larger than 100, the value for 100 is returned.

Parameters:
df - the degrees of freedom (usually sample size - 1)
percentile - the percentile
Returns:
the corresponding student's t value

statisticsForTimeSeries

public static double[] statisticsForTimeSeries(TimeSeries refSeries,
                                               int index1,
                                               TimeSeries testSeries,
                                               int index2,
                                               StatisticsUtil.Percentile percentile)
Returns true if the mean of two data sets is significantly different, such that the probability that they are from the same population is lower than percentile, false otherwise. The data sets are taken from series at index1 and index2.

Note that no conclusion must be drawn from a false return value: it does not indicate that the two data sets are from the same population - there may simply be not enough data to conclude the other way, for example due to a small sample size or large standard deviation.

Also note that a true return value does not say anything about the relevance of the difference - a statistically significant difference may be practically irrelevant if it is small.

XXX the current implementation assumes that the standard deviations are sufficiently similar.

Parameters:
refSeries - the time series containing the first data set
index1 - the index into series1 for the first data set
testSeries - the time series containing the second data set
index2 - the index into series2 for the second data set
percentile - the percentile level to use
Returns:
true if the null hypothesis is rejected on the percentile level, false if it cannot be rejected based on the given data

studentTtest

public static double studentTtest(double[] values,
                                  double[] stddevs,
                                  long[] counts,
                                  StatisticsUtil.Percentile percentile)

deviation

public static double deviation(double[] values)

standardError

public static double standardError(double[] values,
                                   double[] stddevs,
                                   long[] counts)