weka.core
Class Statistics

java.lang.Object
  |
  +--weka.core.Statistics

public class Statistics
extends java.lang.Object

Class implementing some distributions, tests, etc. Most of the code is adapted from Gary Perlman's unixstat.

Author:
Eibe Frank (eibe@cs.waikato.ac.nz)

Constructor Summary
Statistics()
           
 
Method Summary
static double binomialStandardError(double p, int n)
          Computes standard error for observed values of a binomial random variable.
static double chiSquaredProbability(double x, int df)
          Returns chi-squared probability for given value and degrees of freedom.
static double FCriticalValue(double p, int df1, int df2)
          Critical value for given probability of F-distribution.
static double FProbability(double F, int df1, int df2)
          Computes probability of F-ratio.
static void main(java.lang.String[] ops)
          Main method for testing this class.
static double normalProbability(double z)
          Returns probability that the standardized normal variate Z (mean = 0, standard deviation = 1) is less than z.
static double studentTConfidenceInterval(int df, double p, double se)
          Computes absolute size of half of a student-t confidence interval for given degrees of freedom, probability, and observed value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Statistics

public Statistics()
Method Detail

binomialStandardError

public static double binomialStandardError(double p,
                                           int n)
Computes standard error for observed values of a binomial random variable.
Parameters:
p - the probability of success
n - the size of the sample
Returns:
the standard error

chiSquaredProbability

public static double chiSquaredProbability(double x,
                                           int df)
Returns chi-squared probability for given value and degrees of freedom. (The probability that the chi-squared variate will be greater than x for the given degrees of freedom.) Adapted from unixstat by Gary Perlman.
Parameters:
x - the value
df - the number of degrees of freedom

FCriticalValue

public static double FCriticalValue(double p,
                                    int df1,
                                    int df2)
Critical value for given probability of F-distribution. Adapted from unixstat by Gary Perlman.
Parameters:
p - the probability
df1 - the first number of degrees of freedom
df2 - the second number of degrees of freedom
Returns:
the critical value for the given probability

FProbability

public static double FProbability(double F,
                                  int df1,
                                  int df2)
Computes probability of F-ratio. Adapted from unixstat by Gary Perlman. Collected Algorithms of the CACM Algorithm 322 Egon Dorrer
Parameters:
F - the F-ratio
df1 - the first number of degrees of freedom
df2 - the second number of degrees of freedom
Returns:
the probability of the F-ratio.

normalProbability

public static double normalProbability(double z)
Returns probability that the standardized normal variate Z (mean = 0, standard deviation = 1) is less than z. Adapted from unixstat by Gary Perlman.
Parameters:
the - z-value
Returns:
the probability of the z value according to the normal pdf

studentTConfidenceInterval

public static double studentTConfidenceInterval(int df,
                                                double p,
                                                double se)
Computes absolute size of half of a student-t confidence interval for given degrees of freedom, probability, and observed value.
Parameters:
df - the number of degrees of freedom
p - the probability
se - the observed value
Returns:
absolute size of half of a student-t confidence interval

main

public static void main(java.lang.String[] ops)
Main method for testing this class.