|
SSJ V. 1.1.9. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectumontreal.iro.lecuyer.probdist.DiscreteDistribution
public class DiscreteDistribution
Classes implementing discrete distributions over a
finite set of real numbers should inherit from this class.
For discrete distributions over integers,
see DiscreteDistributionInt.
We assume that the random variable X of interest can take one of the
n values
x0 < ... < xn-1 (which are sorted by increasing order).
It takes the value xk with probability
pk = P[X = xk].
In addition to the methods specified in the interface
Distribution,
a method that returns the probability pk is supplied.
Note that the default implementation of the complementary distribution function returns 1.0 - cdf(x - 1), which is not accurate when F(x) is near 1.
| Constructor Summary | |
|---|---|
DiscreteDistribution(int n,
double[] obs,
double[] prob)
Constructs a discrete distribution over the n values contained in array obs, with probabilities given in array prob. |
|
| Method Summary | |
|---|---|
double |
barF(double x)
Returns bar(F)(x) = 1 - F(x). |
double |
cdf(double x)
Computes and returns the distribution function F(x). |
double |
inverseF(double u)
Computes and returns the inverse distribution function F-1(u), defined in. |
double |
prob(int k)
Returns pk, the probability of the k-th observation, for 0 <= k < n. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DiscreteDistribution(int n,
double[] obs,
double[] prob)
| Method Detail |
|---|
public double prob(int k)
k - observation number,
0 <= k < n
public double cdf(double x)
Distribution
cdf in interface Distributionx - value at which the distribution function is evaluated
public double barF(double x)
Distribution
barF in interface Distributionx - value at which the distribution function must be evaluated
public double inverseF(double u)
Distribution
inverseF in interface Distributionx - value at which the complementary distribution function must be evaluated
|
SSJ V. 1.1.9. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||