org.jscience.physics.nuclear.kinematics.math.statistics
Class MathUtils

java.lang.Object
  extended by org.jscience.physics.nuclear.kinematics.math.statistics.MathUtils

public class MathUtils
extends java.lang.Object

DOCUMENT ME!


Constructor Summary
MathUtils()
          Creates a new MathUtils object.
 
Method Summary
static double ave(double[] data)
          DOCUMENT ME!
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)
          DOCUMENT ME!
static double var(double[] data)
          DOCUMENT ME!
 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

MathUtils

public MathUtils()
Creates a new MathUtils object.

Method Detail

ave

public static double ave(double[] data)
DOCUMENT ME!

Parameters:
data - DOCUMENT ME!
Returns:
DOCUMENT ME!

var

public static double var(double[] data)
DOCUMENT ME!

Parameters:
data - DOCUMENT ME!
Returns:
DOCUMENT ME!

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)

Parameters:
a - DOCUMENT ME!
x - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
StatisticsException - DOCUMENT ME!

gser

public static double gser(double a,
                          double x)
                   throws StatisticsException
Parameters:
a - DOCUMENT ME!
x - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
StatisticsException - DOCUMENT ME!

gammln

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

Parameters:
xx - DOCUMENT ME!
Returns:
DOCUMENT ME!

gcf

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

Parameters:
a - DOCUMENT ME!
x - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
StatisticsException - DOCUMENT ME!

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.

Parameters:
func - DOCUMENT ME!
x1 - DOCUMENT ME!
x2 - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
StatisticsException - DOCUMENT ME!

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.

Parameters:
func - DOCUMENT ME!
x1 - DOCUMENT ME!
x2 - DOCUMENT ME!
tol - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
StatisticsException - DOCUMENT ME!

betai

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

Parameters:
a - DOCUMENT ME!
b - DOCUMENT ME!
x - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
StatisticsException - DOCUMENT ME!

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.

Parameters:
tObserved - DOCUMENT ME!
dof - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
StatisticsException - DOCUMENT ME!

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.

Parameters:
dof - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
StatisticsException - DOCUMENT ME!

main

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

Parameters:
args - DOCUMENT ME!