dwvisser.statistics
Class MiscMath

java.lang.Object
  |
  +--dwvisser.statistics.MiscMath

public class MiscMath
extends java.lang.Object


Constructor Summary
MiscMath()
           
 
Method Summary
static double ave(double[] data)
           
static double betai(double a, double b, double x)
          Incomplete beta function.
static double calculateStudentsT(double tObserved, double dof)
          Returns the probability that the absolute value of a t-statistic would be smaller than tObserved, for a t-distribution with dof degrees of freedom and a mean of zero.
static double findOneSigmaT(int dof)
          Calculates t-statistic such that calculateStudentsT(findOneSigmaT(dof),dof) returns 0.683, the one-sigma probability for the normal distribution.
static double gammln(double xx)
          Returns Incomplete gamma P(a,x) evaluated by series.
static double gammq(double a, double x)
          Returns the incomplete gamma function Q(a,x) == 1 - P(a,x).
static double gcf(double a, double x)
          Returns Incomplete gamma Q(a,x) evaluated by series.
static double gser(double a, double x)
           
static void main(java.lang.String[] args)
           
static double var(double[] data)
           
 double[] zbrac(Function func, double x1, double x2)
          From zbrac.c in "Numerical Recipes".
static double zbrent(Function func, double x1, double x2, double tol)
          From zbrent.c in "Numerical Recipes".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MiscMath

public MiscMath()
Method Detail

ave

public static double ave(double[] data)

var

public static double var(double[] data)

gammq

public static double gammq(double a,
                           double x)
                    throws StatisticsException
Returns the incomplete gamma function Q(a,x) == 1 - P(a,x). P(x) == 1/gamma(a)*Intgegrate[exp[-t]t**(a-1),{t,0,x}] ; (a>0)

StatisticsException

gser

public static double gser(double a,
                          double x)
                   throws StatisticsException
StatisticsException

gammln

public static double gammln(double xx)
Returns Incomplete gamma P(a,x) evaluated by series.


gcf

public static double gcf(double a,
                         double x)
                  throws StatisticsException
Returns Incomplete gamma Q(a,x) evaluated by series.

StatisticsException

zbrac

public double[] zbrac(Function func,
                      double x1,
                      double x2)
               throws StatisticsException
From zbrac.c in "Numerical Recipes". Given a Function and initial guessed range x1 to x2, the method expands the range geometrically until a root is bracketed by the values in the returned array. If the range becomes unacceptably large, and exception is thrown, and no bracketing values ever get returned.

StatisticsException

zbrent

public static double zbrent(Function func,
                            double x1,
                            double x2,
                            double tol)
                     throws StatisticsException
From zbrent.c in "Numerical Recipes". Using Brent's method, finds the root of Function func known to lie between x1 and x2. The root is returned, and will be refined until it's accuracy is tol.

StatisticsException

betai

public static double betai(double a,
                           double b,
                           double x)
                    throws StatisticsException
Incomplete beta function. Used to calculate Student's T.

StatisticsException

calculateStudentsT

public static double calculateStudentsT(double tObserved,
                                        double dof)
                                 throws StatisticsException
Returns the probability that the absolute value of a t-statistic would be smaller than tObserved, for a t-distribution with dof degrees of freedom and a mean of zero.

StatisticsException

findOneSigmaT

public static double findOneSigmaT(int dof)
                            throws StatisticsException
Calculates t-statistic such that calculateStudentsT(findOneSigmaT(dof),dof) returns 0.683, the one-sigma probability for the normal distribution.

StatisticsException

main

public static void main(java.lang.String[] args)