Maths
Class Gamma

java.lang.Object
  extended by Maths.Gamma

public class Gamma
extends java.lang.Object

Provides methods associated with the gamma distribution. Provides two static functions, one for calculating the inverse chi-squared distribution and one for calculating the rate for different rate categories under a gmma distribution.

Version:
1.0

Constructor Summary
Gamma()
           
 
Method Summary
static double chi2inv(double p, double v)
          Returns the inverse chi-squared distribution.
static double[] rates(double alpha, int categories)
          Returns the rates that should be used for a set number of rate categories and a set value of alpha as per the methodology of Yang 1993
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Gamma

public Gamma()
Method Detail

rates

public static double[] rates(double alpha,
                             int categories)
Returns the rates that should be used for a set number of rate categories and a set value of alpha as per the methodology of Yang 1993

Parameters:
alpha - The alpha vallue
categories - The number of rate categories
Returns:
The rate for each category

chi2inv

public static double chi2inv(double p,
                             double v)
Returns the inverse chi-squared distribution. Uses the method given in Best and Roberts 1975. Makes calls to private functions using the methods of Bhattacharjee 1970 and Odeh and Evans 1974. All converted to Java by the author (yes, the author knows FORTRAN!)

Parameters:
p - The p-value
v - The number of degrees of freedom
Returns:
The percentage point