public class GammaDistribution extends Distribution implements java.io.Serializable
CONTINUOUS, DISCRETE, MIXED
Constructor and Description |
---|
GammaDistribution()
This default constructor creates a new gamma distribution with shape parameter
1 and scale parameter 1.
|
GammaDistribution(double k,
double b)
This general constructor creates a new gamma distribution with specified
shape parameter and scale parameters.
|
Modifier and Type | Method and Description |
---|---|
double |
getCDF(double x)
This method computes the cumulative distribution function of the distribution.
|
double |
getDensity(double x)
This method computes the probability density function,
|
double |
getMaxDensity()
This method returns the maximum value of the density function.
|
double |
getMean()
This method returns the mean bk.
|
double |
getMGF(double t)
This method returns the moment generating function.
|
double |
getMoment(double a,
int n)
This method returns the moment a specified order about a specified point.
|
double |
getMoment(int n)
This method returns the moment of order n.
|
double |
getScale()
This method returns the scale parameter.
|
double |
getShape()
This method returns the shape parameter.
|
double |
getVariance()
This method returns the variance kb2.
|
void |
setParameters(double k,
double b)
This method sets the parameters and creates the default domain.
|
void |
setScale(double b)
This method sets the scale parameters.
|
void |
setShape(double k)
This method sets the shape parameter.
|
double |
simulate()
This method simulates a value from the distribution.
|
java.lang.String |
toString()
This method returns a string that gives the name of the distribution and the values of
the parameters.
|
getDomain, getFailureRate, getMedian, getPGF, getQuantile, getSD, getType, setDomain, setDomain
public GammaDistribution(double k, double b)
k
- the shape parameterb
- the scale parameterpublic GammaDistribution()
public void setParameters(double k, double b)
k
- the shape parameterb
- the scale parameterpublic void setShape(double k)
k
- the shape parameterpublic double getShape()
public void setScale(double b)
b
- the scale parameterpublic double getScale()
public double getDensity(double x)
getDensity
in class Distribution
x
- a number > 0public double getMaxDensity()
getMaxDensity
in class Distribution
public double getMean()
getMean
in class Distribution
public double getVariance()
getVariance
in class Distribution
public double getMoment(int n)
getMoment
in class Distribution
n
- the orderpublic double getMoment(double a, int n)
getMoment
in class Distribution
a
- the centern
- the orderpublic double getMGF(double t)
getMGF
in class Distribution
t
- a number in the domain of the MGFpublic double getCDF(double x)
getCDF
in class Distribution
x
- a number in the domain of the distributionpublic double simulate()
simulate
in class Distribution
public java.lang.String toString()
toString
in class Distribution