public class BetaDistribution extends AbstractDistribution implements ExponentialFamily
| Modifier and Type | Field and Description |
|---|---|
double |
alpha
The shape parameter.
|
double |
beta
The shape parameter.
|
| Constructor and Description |
|---|
BetaDistribution(double alpha,
double beta)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
double |
cdf(double x)
Cumulative distribution function.
|
double |
entropy()
Shannon entropy of the distribution.
|
static BetaDistribution |
fit(double[] data)
Estimates the distribution parameters by the moment method.
|
double |
getAlpha()
Returns the shape parameter alpha.
|
double |
getBeta()
Returns the shape parameter beta.
|
int |
length()
The number of parameters of the distribution.
|
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.
|
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.
|
java.lang.String |
toString() |
double |
variance()
The variance of distribution.
|
inverseTransformSampling, quantile, quantile, rejectionclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitlikelihood, logLikelihood, rand, sdpublic final double alpha
public final double beta
public BetaDistribution(double alpha,
double beta)
alpha - shape parameter.beta - shape parameter.public static BetaDistribution fit(double[] data)
public double getAlpha()
public double getBeta()
public int length()
Distributionlength in interface Distributionpublic double mean()
Distributionmean in interface Distributionpublic double variance()
Distributionvariance in interface Distributionpublic double entropy()
Distributionentropy in interface Distributionpublic java.lang.String toString()
toString in class java.lang.Objectpublic 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.public double rand()
Distributionrand in interface Distribution