25package umontreal.ssj.probdist;
82 protected final static double EPS_EXTRA = 1.0e-6;
83 protected double cdf[] =
null;
84 protected double pdf[] =
null;
85 protected int xmin = 0;
86 protected int xmax = 0;
89 protected int xmed = 0;
92 protected int supportA = Integer.MIN_VALUE;
93 protected int supportB = Integer.MAX_VALUE;
101 public abstract double prob(
int x);
111 public double cdf(
double x) {
122 public abstract double cdf(
int x);
133 return barF((
int) x);
146 return 1.0 - cdf(x - 1);
204 if (u < 0.0 || u > 1.0)
205 throw new IllegalArgumentException(
"u is not in [0,1]");
215 if (u <= cdf[xmed - xmin]) {
231 if (u < cdf[xmax - xmin])
Classes implementing discrete distributions over the integers should inherit from this class.
abstract double cdf(int x)
Returns the distribution function evaluated at (see ( FDistDisc )).
int getXsup()
Returns the upper limit of the support of the probability mass function.
abstract double prob(int x)
Returns , the probability of .
double barF(int x)
Returns , the complementary distribution function.
double barF(double x)
Returns , the complementary distribution function.
double inverseF(double u)
Returns the inverse distribution function , where.
static double EPSILON
Environment variable that determines what probability terms can be considered as negligible when buil...
double cdf(double x)
Returns the distribution function evaluated at (see ( FDistDisc )).
int inverseFInt(double u)
Returns the inverse distribution function , where.
int getXinf()
Returns the lower limit of the support of the probability mass function.
This interface should be implemented by all classes supporting discrete and continuous distributions.