|
|||||||||
PREV CLASS NEXT CLASS | All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math.distribution.AbstractDistribution
org.apache.commons.math.distribution.AbstractIntegerDistribution
org.apache.commons.math.distribution.ZipfDistributionImpl
public class ZipfDistributionImpl
Implementation for the ZipfDistribution
.
Constructor Summary | |
---|---|
ZipfDistributionImpl(int numberOfElements,
double exponent)
Create a new Zipf distribution with the given number of elements and exponent. |
Method Summary | |
---|---|
double |
cumulativeProbability(int x)
The probability distribution function P(X <= x) for a Zipf distribution. |
double |
getExponent()
Get the exponent characterising the distribution. |
int |
getNumberOfElements()
Get the number of elements (e.g. |
int |
getSupportLowerBound()
Returns the lower bound of the support for the distribution. |
int |
getSupportUpperBound()
Returns the upper bound of the support for the distribution. |
double |
probability(int x)
The probability mass function P(X = x) for a Zipf distribution. |
void |
setExponent(double s)
Deprecated. as of 2.1 (class will become immutable in 3.0) |
void |
setNumberOfElements(int n)
Deprecated. as of 2.1 (class will become immutable in 3.0) |
Methods inherited from class org.apache.commons.math.distribution.AbstractIntegerDistribution |
---|
cumulativeProbability, cumulativeProbability, cumulativeProbability, inverseCumulativeProbability, isSupportLowerBoundInclusive, isSupportUpperBoundInclusive, probability, reseedRandomGenerator, sample, sample |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.commons.math.distribution.IntegerDistribution |
---|
cumulativeProbability, inverseCumulativeProbability |
Methods inherited from interface org.apache.commons.math.distribution.DiscreteDistribution |
---|
probability |
Methods inherited from interface org.apache.commons.math.distribution.Distribution |
---|
cumulativeProbability, cumulativeProbability |
Constructor Detail |
---|
public ZipfDistributionImpl(int numberOfElements, double exponent) throws IllegalArgumentException
IllegalArgumentException
is thrown.
numberOfElements
- the number of elementsexponent
- the exponent
IllegalArgumentException
- if n ≤ 0 or s ≤ 0.0Method Detail |
---|
public int getNumberOfElements()
getNumberOfElements
in interface ZipfDistribution
@Deprecated public void setNumberOfElements(int n)
IllegalArgumentException
is thrown.
setNumberOfElements
in interface ZipfDistribution
n
- the number of elements
IllegalArgumentException
- if n ≤ 0public double getExponent()
getExponent
in interface ZipfDistribution
@Deprecated public void setExponent(double s)
IllegalArgumentException
is thrown.
setExponent
in interface ZipfDistribution
s
- the exponent
IllegalArgumentException
- if s ≤ 0.0public double probability(int x)
probability
in interface IntegerDistribution
x
- the value at which the probability density function is evaluated.
public double cumulativeProbability(int x)
cumulativeProbability
in interface IntegerDistribution
cumulativeProbability
in class AbstractIntegerDistribution
x
- the value at which the PDF is evaluated.
public int getSupportLowerBound()
public int getSupportUpperBound()
|
|||||||||
PREV CLASS NEXT CLASS | All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |