SSJ
V. 2.6.

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.

The (non-static) nextDouble method simply calls inverseF on the distribution.


Constructor Summary
LaplaceGen(RandomStream s)
          Creates a Laplace random variate generator with parameters μ = 0 and β = 1, using stream s.
LaplaceGen(RandomStream s, double mu, double beta)
          Creates a Laplace random variate generator with parameters μ = mu and β = beta, using stream s.
LaplaceGen(RandomStream s, LaplaceDist dist)
          Creates a new generator for the Laplace distribution dist and stream s.
 
Method Summary
 double getBeta()
          Returns the parameter β.
 double getMu()
          Returns the parameter μ.
static double nextDouble(RandomStream s, double mu, double beta)
          Generates a new variate from the Laplace distribution with parameters μ = mu and β = beta, using stream s.
 
Methods inherited from class umontreal.iro.lecuyer.randvar.RandomVariateGen
getDistribution, getStream, nextArrayOfDouble, nextDouble, setStream, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LaplaceGen

public LaplaceGen(RandomStream s,
                  double mu,
                  double beta)
Creates a Laplace random variate generator with parameters μ = mu and β = beta, using stream s.


LaplaceGen

public LaplaceGen(RandomStream s)
Creates a Laplace random variate generator with parameters μ = 0 and β = 1, using stream s.


LaplaceGen

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

Method Detail

nextDouble

public static double nextDouble(RandomStream s,
                                double mu,
                                double beta)
Generates a new variate from the Laplace distribution with parameters μ = mu and β = beta, using stream s.


getMu

public double getMu()
Returns the parameter μ.


getBeta

public double getBeta()
Returns the parameter β.


SSJ
V. 2.6.

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