SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
umontreal.ssj.probdist.ConstantIntDist Class Reference

Represents a constant discrete distribution taking a single integer value with probability 1. More...

Inheritance diagram for umontreal.ssj.probdist.ConstantIntDist:
umontreal.ssj.probdist.UniformIntDist umontreal.ssj.probdist.DiscreteDistributionInt umontreal.ssj.probdist.Distribution

Public Member Functions

 ConstantIntDist (int c)
 Constructs a new constant distribution with probability 1 at c.
String toString ()
 Returns a String containing information about the current distribution.
Public Member Functions inherited from umontreal.ssj.probdist.UniformIntDist
 UniformIntDist (int i, int j)
 Constructs a discrete uniform distribution over the interval \([i,j]\).
double prob (int x)
 Returns \(p(x)\), the probability of \(x\).
double cdf (int x)
 Returns the distribution function \(F\) evaluated at \(x\) (see ( FDistDisc )).
double barF (int x)
 Returns \(\bar{F}(x)\), the complementary distribution function.
int inverseFInt (double u)
 Returns the inverse distribution function \(F^{-1}(u)\), where.
double getMean ()
 Returns the mean of the distribution function.
double getVariance ()
 Returns the variance of the distribution function.
double getStandardDeviation ()
 Returns the standard deviation of the distribution function.
int getI ()
 Returns the parameter \(i\).
int getJ ()
 Returns the parameter \(j\).
void setParams (int i, int j)
 Sets the parameters \(i\) and \(j\) for this object.
double[] getParams ()
 Return a table containing the parameters of the current distribution.
Public Member Functions inherited from umontreal.ssj.probdist.DiscreteDistributionInt
double cdf (double x)
 Returns the distribution function \(F\) evaluated at \(x\) (see ( FDistDisc )).
double barF (double x)
 Returns \(\bar{F}(x)\), the complementary distribution function.
int getXinf ()
 Returns the lower limit \(x_a\) of the support of the probability mass function.
int getXsup ()
 Returns the upper limit \(x_b\) of the support of the probability mass function.
double inverseF (double u)
 Returns the inverse distribution function \(F^{-1}(u)\), where.

Additional Inherited Members

Static Public Member Functions inherited from umontreal.ssj.probdist.UniformIntDist
static double prob (int i, int j, int x)
 Computes the discrete uniform probability \(p(x)\) defined in ( fmassuniformint ).
static double cdf (int i, int j, int x)
 Computes the discrete uniform distribution function defined in ( cdfuniformint ).
static double barF (int i, int j, int x)
 Computes the discrete uniform complementary distribution function.
static int inverseF (int i, int j, double u)
 Computes the inverse of the discrete uniform distribution function ( invuniformint ).
static double[] getMLE (int[] x, int n)
 Estimates the parameters \((i, j)\) of the uniform distribution over integers using the maximum likelihood method, from the \(n\) observations \(x[k]\), \(k = 0, 1, …, n-1\).
static UniformIntDist getInstanceFromMLE (int[] x, int n)
 Creates a new instance of a discrete uniform distribution over integers with parameters \(i\) and \(j\) estimated using the maximum likelihood method based on the \(n\) observations.
static double getMean (int i, int j)
 Computes and returns the mean \(E[X] = (i + j)/2\) of the discrete uniform distribution.
static double getVariance (int i, int j)
 Computes and returns the variance \(\mbox{Var}[X] = [(j - i + 1)^2 - 1]/{12}\) of the discrete uniform distribution.
static double getStandardDeviation (int i, int j)
 Computes and returns the standard deviation of the discrete uniform distribution.
Static Public Attributes inherited from umontreal.ssj.probdist.DiscreteDistributionInt
static double EPSILON = 1.0e-16
 Environment variable that determines what probability terms can be considered as negligible when building precomputed tables for distribution and mass functions.

Detailed Description

Represents a constant discrete distribution taking a single integer value with probability 1.

Its mass function is

\[ p(x) = \left\{\begin{array}{ll} 1, & \qquad\mbox{for } x = c, \\ 0, & \qquad\mbox{elsewhere. } \end{array}\right. \tag{fconsint} \]

Its distribution function is

\[ F(x) = \left\{\begin{array}{ll} 0, & \qquad\mbox{ for } x < c \\ 1, & \qquad\mbox{ for } x \ge c. \end{array}\right. \tag{cdfconsint} \]

Definition at line 42 of file ConstantIntDist.java.

Constructor & Destructor Documentation

◆ ConstantIntDist()

umontreal.ssj.probdist.ConstantIntDist.ConstantIntDist ( int c)

Constructs a new constant distribution with probability 1 at c.

Definition at line 47 of file ConstantIntDist.java.

Member Function Documentation

◆ toString()

String umontreal.ssj.probdist.ConstantIntDist.toString ( )

Returns a String containing information about the current distribution.

Reimplemented from umontreal.ssj.probdist.UniformIntDist.

Definition at line 54 of file ConstantIntDist.java.


The documentation for this class was generated from the following file: