public class ChiSquareDistribution extends AbstractDistribution implements ExponentialFamily
The chi-square distribution has numerous applications in inferential statistics, for instance in chi-square tests and in estimating variances. Many other statistical tests also lead to a use of this distribution, like Friedman's analysis of variance by ranks.
| Constructor and Description |
|---|
ChiSquareDistribution(int nu)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
double |
cdf(double x)
Cumulative distribution function.
|
double |
entropy()
Shannon entropy of the distribution.
|
int |
getNu()
Returns the parameter nu, the degrees of freedom.
|
double |
logp(double x)
The density at x in log scale, which may prevents the underflow problem.
|
Mixture.Component |
M(double[] x,
double[] posteriori)
The M step in the EM algorithm, which depends the specific distribution.
|
double |
mean()
The mean of distribution.
|
int |
npara()
The number of parameters of the distribution.
|
double |
p(double x)
The probability density function for continuous distribution
or probability mass function for discrete distribution at x.
|
double |
quantile(double p)
The quantile, the probability to the left of quantile is p.
|
double |
rand()
Generates a random number following this distribution.
|
double |
sd()
The standard deviation of distribution.
|
java.lang.String |
toString() |
double |
var()
The variance of distribution.
|
inverseTransformSampling, likelihood, logLikelihood, quantile, quantile, rejectionpublic ChiSquareDistribution(int nu)
nu - the degree of freedom.public int getNu()
public int npara()
Distributionnpara in interface Distributionpublic double mean()
Distributionmean in interface Distributionpublic double var()
Distributionvar in interface Distributionpublic double sd()
Distributionsd in interface Distributionpublic double entropy()
Distributionentropy in interface Distributionpublic java.lang.String toString()
toString in class java.lang.Objectpublic double rand()
Distributionrand in interface Distributionpublic double p(double x)
Distributionp in interface Distributionpublic double logp(double x)
Distributionlogp in interface Distributionpublic double cdf(double x)
Distributioncdf in interface Distributionpublic double quantile(double p)
Distributionquantile in interface Distributionpublic Mixture.Component M(double[] x, double[] posteriori)
ExponentialFamilyM in interface ExponentialFamilyx - the input data for estimationposteriori - the posteriori probability.