ibspan.tss.um.statistics
Class StatisticCalculator

java.lang.Object
  extended by ibspan.tss.um.statistics.StatisticCalculator

public class StatisticCalculator
extends Object

Calculator for simple statistic operations.

Author:
Maciej Gawinecki

Constructor Summary
StatisticCalculator()
           
 
Method Summary
static double binomialMean(double p, double n)
          Computes mean value for binomial distribution.
static double binomialStdDev(double p, double n)
          Computes standard deviation for binomial distribution.
static double expectedValue(double[] population)
          Calculates expected value for distribution with given sample population.
static double normalQuantile(double prob)
          Compute Z statistic for normal distribution.
static double quantile(int q, int k, double[] population)
          Estimating of k-th q-quantile based on empirical distribution function with averaging.
static double sigmoid(double x, double a)
          Computes sigmoid function for the given argument
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatisticCalculator

public StatisticCalculator()
Method Detail

normalQuantile

public static double normalQuantile(double prob)
Compute Z statistic for normal distribution.

Parameters:
prob -
Returns:

binomialMean

public static double binomialMean(double p,
                                  double n)
Computes mean value for binomial distribution.

Parameters:
p - probability of success
n - number of success
Returns:
mean value

binomialStdDev

public static double binomialStdDev(double p,
                                    double n)
Computes standard deviation for binomial distribution.

Parameters:
p - probability of success
n - number of probes
Returns:
standandar deviation

sigmoid

public static double sigmoid(double x,
                             double a)
Computes sigmoid function for the given argument

Parameters:
x - argument
a - 'a' parameter
Returns:
value of the function

quantile

public static double quantile(int q,
                              int k,
                              double[] population)
Estimating of k-th q-quantile based on empirical distribution function with averaging. Detailed equations can be found here.

Parameters:
q - is order of quantile
k - is number of quantile
population - sample population sorted ascendingly
Returns:
value of k-th q-quantile from the given population

expectedValue

public static double expectedValue(double[] population)
Calculates expected value for distribution with given sample population. In fact this is average, since each individual in population has the same probability.

Parameters:
population - is sample population
Returns:
exptected value