SSJ
V. 1.2.5.

umontreal.iro.lecuyer.randvar
Class LaplaceGen

java.lang.Object
  extended by umontreal.iro.lecuyer.randvar.RandomVariateGen
      extended by umontreal.iro.lecuyer.randvar.LaplaceGen

public class LaplaceGen
extends RandomVariateGen

This class implements methods for generating random variates from the Laplace distribution. Its density is

f (x) = (1/(2φ))e-| x-θ|/φ for - ∞ < x < ∞

where φ > 0.

No local copy of the parameters θ and φ is maintained in this class. The (non-static) nextDouble method simply calls inverseF on the distribution.


Constructor Summary
LaplaceGen(RandomStream s, LaplaceDist dist)
          Creates a new generator for the Laplace distribution dist and stream s.
 
Method Summary
 double nextDouble()
          Generates a random number from the continuous distribution contained in this object.
static double nextDouble(RandomStream s, double theta, double phi)
          Generates a new variate from the Laplace distribution with parameters θ = theta and φ = phi, using stream s.
 
Methods inherited from class umontreal.iro.lecuyer.randvar.RandomVariateGen
getDistribution, getStream, nextArrayOfDouble, setStream
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LaplaceGen

public LaplaceGen(RandomStream s,
                  LaplaceDist dist)
Creates a new generator for the Laplace distribution dist and stream s.

Method Detail

nextDouble

public double nextDouble()
Description copied from class: RandomVariateGen
Generates a random number from the continuous distribution contained in this object. By default, this method uses inversion by calling the inverseF method of the distribution object. Alternative generating methods are provided in subclasses.

Overrides:
nextDouble in class RandomVariateGen
Returns:
the generated value

nextDouble

public static double nextDouble(RandomStream s,
                                double theta,
                                double phi)
Generates a new variate from the Laplace distribution with parameters θ = theta and φ = phi, using stream s.


SSJ
V. 1.2.5.

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