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

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

Inheritance diagram for umontreal.ssj.probdist.ConstantDist:
umontreal.ssj.probdist.DiscreteDistribution umontreal.ssj.probdist.Distribution

Public Member Functions

 ConstantDist (double c)
 Constructs a new constant distribution with probability 1 at c.
double getMean ()
 Returns the mean \(E[X] = c\).
double getVariance ()
 Returns the variance \(\mbox{Var}[X] = 0\).
double getStandardDeviation ()
 Returns the standard deviation = 0.
double inverseF (double u)
 Returns the inverse distribution function \(c = F^{-1}(u)\).
Public Member Functions inherited from umontreal.ssj.probdist.DiscreteDistribution
 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).
double cdf (double x)
double barF (double x)
double[] getParams ()
 Returns a table containing the parameters of the current distribution.
int getN ()
 Returns the number of possible values \(x_i\).
double prob (int i)
 Returns \(p_i\), the probability of the \(i\)-th value, for.
double getValue (int i)
 Returns the \(i\)-th value \(x_i\), for \(0\le i<n\).
double getXinf ()
 Returns the lower limit \(x_0\) of the support of the distribution.
double getXsup ()
 Returns the upper limit \(x_{n-1}\) of the support of the distribution.
String toString ()
 Returns a String containing information about the current distribution.

Detailed Description

Represents a constant discrete distribution taking a single real 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{fcons} \]

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{cdfcons} \]

Definition at line 42 of file ConstantDist.java.

Constructor & Destructor Documentation

◆ ConstantDist()

umontreal.ssj.probdist.ConstantDist.ConstantDist ( double c)

Constructs a new constant distribution with probability 1 at c.

Definition at line 48 of file ConstantDist.java.

Member Function Documentation

◆ getMean()

double umontreal.ssj.probdist.ConstantDist.getMean ( )

Returns the mean \(E[X] = c\).

Returns
\(c\)

Reimplemented from umontreal.ssj.probdist.DiscreteDistribution.

Definition at line 59 of file ConstantDist.java.

◆ getStandardDeviation()

double umontreal.ssj.probdist.ConstantDist.getStandardDeviation ( )

Returns the standard deviation = 0.

Returns
0

Reimplemented from umontreal.ssj.probdist.DiscreteDistribution.

Definition at line 79 of file ConstantDist.java.

◆ getVariance()

double umontreal.ssj.probdist.ConstantDist.getVariance ( )

Returns the variance \(\mbox{Var}[X] = 0\).

Returns
0

Reimplemented from umontreal.ssj.probdist.DiscreteDistribution.

Definition at line 69 of file ConstantDist.java.

◆ inverseF()

double umontreal.ssj.probdist.ConstantDist.inverseF ( double u)

Returns the inverse distribution function \(c = F^{-1}(u)\).

Returns
\(c\)

Reimplemented from umontreal.ssj.probdist.DiscreteDistribution.

Definition at line 89 of file ConstantDist.java.


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