JMSLTM Numerical Library 6.0

com.imsl.stat
Class GammaDistribution

java.lang.Object
  extended by com.imsl.stat.GammaDistribution
All Implemented Interfaces:
Distribution, ProbabilityDistribution, Serializable

public class GammaDistribution
extends Object
implements ProbabilityDistribution, Serializable

Evaluates a gamma probability distribution.

The GammaDistribution evaluates the gamma probability distribution of a given set of data, xData. If parameters are not supplied, the eval method first calculates the shape and scale parameters by using a MLE technique for a best fit. The gamma probability distribution is defined as:

f(x)= {x}^{a-1}frac{e^{-frac{x}{b}}} {b^a Gamma(a)} mbox{,},,,x gt 0 ,mbox{,},,a gt 0 ,,,mbox{and},,, b gt 0 ,,mbox{,}

where a and b are the scale and shape parameters.

See Also:
Serialized Form

Constructor Summary
GammaDistribution()
           
 
Method Summary
 double[] eval(double[] xData)
          Evaluates a gamma probability distribution from a given set of data.
 double[] eval(double[] xData, Object[] parameters)
          Evaluates a gamma probability distribution from a given set of data.
 double eval(double xData, Object[] parameters)
          Evaluates a gamma probability distribution at a given point xData.
 Object[] getParameters()
          Returns the parameters used to evaluate the distribution.
 double getScaleParameter()
          Returns the maximum-likelihood estimate found for the gamma scale parameter.
 double getShapeParameter()
          Returns the maximum-likelihood estimate found for the gamma shape parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GammaDistribution

public GammaDistribution()
Method Detail

eval

public double[] eval(double[] xData)
Evaluates a gamma probability distribution from a given set of data.

Specified by:
eval in interface Distribution
Parameters:
xData - a double array representing the points the gamma probability distribution function is to evaluate.
Returns:
a double array representing the gamma probability distribution of xData.

eval

public double[] eval(double[] xData,
                     Object[] parameters)
Evaluates a gamma probability distribution from a given set of data.

Specified by:
eval in interface ProbabilityDistribution
Parameters:
xData - a double array representing the points at which the gamma probability distribution function is to evaluate.
parameters - an Object array representing the parameters used to evaluate the gamma distribution.
Returns:
a double array representing the gamma probability distribution of xData.

eval

public double eval(double xData,
                   Object[] parameters)
Evaluates a gamma probability distribution at a given point xData.

Specified by:
eval in interface ProbabilityDistribution
Parameters:
xData - a double representing the point at which the gamma probability distribution function is to be evaluated.
parameters - an Object array representing the parameters used to evaluate the gamma distribution.
Returns:
a double representing the gamma probability distribution of xData.

getParameters

public Object[] getParameters()
Returns the parameters used to evaluate the distribution.

Specified by:
getParameters in interface ProbabilityDistribution
Returns:
an Object array representing the shape and scale parameters used to evaluate the distribution. This Object array can be retrieved after invoking the eval method with the following signature, double[] eval(double[] xData). This Object array can be used as input later with another set of data to the eval methods that require an Object array of distribution parameters as input.

getScaleParameter

public double getScaleParameter()
Returns the maximum-likelihood estimate found for the gamma scale parameter.

Returns:
a double representing the maximum-likelihood estimate found for the gamma scale parameter.

getShapeParameter

public double getShapeParameter()
Returns the maximum-likelihood estimate found for the gamma shape parameter.

Returns:
a double representing the maximum-likelihood estimate found for the gamma shape parameter.

JMSLTM Numerical Library 6.0

Copyright © 1970-2009 Visual Numerics, Inc.
Built September 1 2009.