Overview | Package | Class | Tree | Deprecated | Index | Help
| SSJ V. 2.1.1.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## umontreal.iro.lecuyer.randvar
Class LaplaceGen

    java.lang.Object
      umontreal.iro.lecuyer.randvar.RandomVariateGen
          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`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, 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 β.

Overview | Package | Class | Tree | Deprecated | Index | Help
| SSJ V. 2.1.1.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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