|
SSJ V. 2.6. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object umontreal.iro.lecuyer.probdist.DiscreteDistribution
public class DiscreteDistribution
This class implements discrete distributions over a finite set of real numbers
(also over integers as a particular case).
We assume that the random variable X of interest can take one of the
n values
x0 < ... < xn-1, which must be sorted by
increasing order.
X can take 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.
Constructor Summary | |
---|---|
DiscreteDistribution(double[] params)
Deprecated. |
|
DiscreteDistribution(double[] values,
double[] prob,
int n)
Constructs a discrete distribution over the n values contained in array values, with probabilities given in array prob. |
|
DiscreteDistribution(int[] values,
double[] prob,
int n)
Similar to DiscreteDistribution (double[], double[], int). |
Method Summary | |
---|---|
double |
barF(double x)
Returns bar(F)(x) = 1 - F(x). |
double |
cdf(double x)
Returns the distribution function F(x). |
double |
getMean()
Computes the mean E[X] = ∑ipixi of the distribution. |
int |
getN()
Returns the number of possible values xi. |
double[] |
getParams()
Returns a table containing the parameters of the current distribution. |
double |
getStandardDeviation()
Computes the standard deviation of the distribution. |
double |
getValue(int i)
Returns the i-th value xi, for 0 <= i < n. |
double |
getVariance()
Computes the variance Var[X] = ∑ipi(xi - E[X])2 of the distribution. |
double |
getXinf()
Returns the lower limit x0 of the support of the distribution. |
double |
getXsup()
Returns the upper limit xn-1 of the support of the distribution. |
double |
inverseF(double u)
Returns the inverse distribution function F-1(u), defined in. |
double |
prob(int i)
Returns pi, the probability of the i-th value, for 0 <= i < n. |
String |
toString()
Returns a String containing information about the current distribution. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DiscreteDistribution(double[] values, double[] prob, int n)
public DiscreteDistribution(int[] values, double[] prob, int n)
DiscreteDistribution
(double[], double[], int).
@Deprecated public DiscreteDistribution(double[] params)
Method Detail |
---|
public double cdf(double x)
Distribution
cdf
in interface Distribution
x
- value at which the distribution function is evaluated
public double barF(double x)
Distribution
barF
in interface Distribution
x
- value at which the complementary distribution function is evaluated
public double inverseF(double u)
Distribution
inverseF
in interface Distribution
u
- value in the interval (0, 1) for which the inverse
distribution function is evaluated
public double getMean()
getMean
in interface Distribution
public double getVariance()
getVariance
in interface Distribution
public double getStandardDeviation()
getStandardDeviation
in interface Distribution
public double[] getParams()
getParams
in interface Distribution
public int getN()
public double prob(int i)
i
- value number,
0 <= i < n
public double getValue(int i)
public double getXinf()
public double getXsup()
public String toString()
toString
in class Object
|
SSJ V. 2.6. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |