public class ChiSquareDistribution extends GammaDistribution implements java.io.Serializable
CONTINUOUS, DISCRETE, MIXED
Constructor and Description |
---|
ChiSquareDistribution()
This default constructor creates a new chi-square distribution with
1 degree of freedom.
|
ChiSquareDistribution(int n)
This general constructor creates a new chi-square distribuiton with a
specified degrees of freedom parameter.
|
Modifier and Type | Method and Description |
---|---|
int |
getDegrees()
This method returns the degrees of freedom parameter.
|
void |
setDegrees(int n)
This method sets the degrees of freedom parameter and computes the
defaut domain.
|
void |
setParameters(double k,
double b)
This method sets the gamma parameters, which must be related to the degrees
of freedom.
|
void |
setScale(double b)
This method sets the scale parameter, which must be 2.
|
void |
setShape(double k)
This method sets the shape parameter, which must be n/2, where n is
the degrees of freedom.
|
double |
simulate()
This method simulates a value from the distribuiton, as the sum of squares
of independent, standard normal distribution.
|
java.lang.String |
toString()
This method returns a string that gives the name of the distribution and the values of
the parameters.
|
getCDF, getDensity, getMaxDensity, getMean, getMGF, getMoment, getMoment, getScale, getShape, getVariance
getDomain, getFailureRate, getMedian, getPGF, getQuantile, getSD, getType, setDomain, setDomain
public ChiSquareDistribution(int n)
n
- the degrees of freedompublic ChiSquareDistribution()
public void setDegrees(int n)
n
- the degrees of freedompublic int getDegrees()
public double simulate()
simulate
in class GammaDistribution
public void setShape(double k)
setShape
in class GammaDistribution
k
- the shape parameterpublic void setScale(double b)
setScale
in class GammaDistribution
b
- the scale parameterpublic void setParameters(double k, double b)
setParameters
in class GammaDistribution
k
- the shape parameterb
- the scale parameterpublic java.lang.String toString()
toString
in class GammaDistribution