jbil.rv
Class IntIntervalDist

java.lang.Object
  extended by umontreal.iro.lecuyer.probdist.DiscreteDistributionInt
      extended by jbil.rv.IntIntervalDist
All Implemented Interfaces:
umontreal.iro.lecuyer.probdist.Distribution

public class IntIntervalDist
extends umontreal.iro.lecuyer.probdist.DiscreteDistributionInt

Distribution for an integer-valued r.v. taking values in a range l,l+1,...,l+W-1 with probabilities p_0,...,p_{W-1}.

Author:
Paulo G. S. da Fonseca

Field Summary
 
Fields inherited from class umontreal.iro.lecuyer.probdist.DiscreteDistributionInt
EPSILON
 
Constructor Summary
IntIntervalDist(int lowerLimit, double[] weights)
          Creates a distribution for an integer-valued r.v.
 
Method Summary
 double cdf(int x)
           
 double getMean()
           
 double[] getParams()
          Returns the array {lowerLimit, weights[0],...,weights[W-1]}
 double getStandardDeviation()
           
 double getVariance()
           
 double prob(int x)
           
 
Methods inherited from class umontreal.iro.lecuyer.probdist.DiscreteDistributionInt
barF, barF, cdf, inverseF, inverseFInt
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntIntervalDist

public IntIntervalDist(int lowerLimit,
                       double[] weights)
Creates a distribution for an integer-valued r.v. taking values in the range lowerLimit, lowerLimit+1,..,lowerLimit+W-1, where W is the length of the weights vector. This distribution is so that P(X=lowerLimit+x)=weights[x]/sum(weights) for x=0,...,W-1 and 0 otherwise. The weights[] array must contain only non-negative values.

Parameters:
lowerLimit - Lower limit of the r.v. domain
weights - Weights vector containg the relative weight of the values lowerLimit, lowerLimit+1,..
Method Detail

cdf

public double cdf(int x)
Specified by:
cdf in class umontreal.iro.lecuyer.probdist.DiscreteDistributionInt

prob

public double prob(int x)
Specified by:
prob in class umontreal.iro.lecuyer.probdist.DiscreteDistributionInt

getMean

public double getMean()

getParams

public double[] getParams()
Returns the array {lowerLimit, weights[0],...,weights[W-1]}


getStandardDeviation

public double getStandardDeviation()

getVariance

public double getVariance()