SSJ
V. 2.6.

umontreal.iro.lecuyer.probdist
Class ConstantDist

java.lang.Object
  extended by umontreal.iro.lecuyer.probdist.DiscreteDistribution
      extended by umontreal.iro.lecuyer.probdist.ConstantDist
All Implemented Interfaces:
Distribution

public class ConstantDist
extends DiscreteDistribution

Represents a constant discrete distribution taking a single real value with probability 1. Its mass function is

p(x) = 1,        for x = c,

and p(x) = 0 elsewhere.


Constructor Summary
ConstantDist(double c)
          Constructs a new constant distribution with probability 1 at c.
 
Method Summary
 double getMean()
          Returns the mean E[X] = c.
 double getStandardDeviation()
          Returns the standard deviation = 0.
 double getVariance()
          Returns the variance Var[X] = 0.
 double inverseF(double u)
          Returns the inverse distribution function c = F-1(u).
 
Methods inherited from class umontreal.iro.lecuyer.probdist.DiscreteDistribution
barF, cdf, getN, getParams, getValue, getXinf, getXsup, prob, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConstantDist

public ConstantDist(double c)
Constructs a new constant distribution with probability 1 at c.

Method Detail

getMean

public double getMean()
Returns the mean E[X] = c.

Specified by:
getMean in interface Distribution
Overrides:
getMean in class DiscreteDistribution
Returns:
c

getVariance

public double getVariance()
Returns the variance Var[X] = 0.

Specified by:
getVariance in interface Distribution
Overrides:
getVariance in class DiscreteDistribution
Returns:
0

getStandardDeviation

public double getStandardDeviation()
Returns the standard deviation = 0.

Specified by:
getStandardDeviation in interface Distribution
Overrides:
getStandardDeviation in class DiscreteDistribution
Returns:
0

inverseF

public double inverseF(double u)
Returns the inverse distribution function c = F-1(u).

Specified by:
inverseF in interface Distribution
Overrides:
inverseF in class DiscreteDistribution
Parameters:
u - value in the interval (0, 1) for which the inverse distribution function is evaluated
Returns:
c

SSJ
V. 2.6.

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.