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 NormalGen

    java.lang.Object
      umontreal.iro.lecuyer.randvar.RandomVariateGen
          umontreal.iro.lecuyer.randvar.NormalGen

Direct Known Subclasses:
  NormalACRGen, NormalBoxMullerGen, NormalKindermannRamageGen, NormalPolarGen

    public class NormalGen

extends RandomVariateGen

This class implements methods for generating random variates from the normal distribution N(μ, σ). It has mean μ and variance σ2, where σ > 0. Its density function is

f (x) = 1/(2π)1/2σe(x-μ)2/(2σ2)

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

Constructor Summary
`NormalGen(RandomStream s)` Creates a standard normal random variate generator with mean `0` and standard deviation `1`, using stream `s`.
`NormalGen(RandomStream s, double mu, double sigma)` Creates a normal random variate generator with mean `mu` and standard deviation `sigma`, using stream `s`.
`NormalGen(RandomStream s, NormalDist dist)` Creates a random variate generator for the normal distribution `dist` and stream `s`.

Method Summary
`double` | `getMu()` Returns the parameter μ of this object.
`double` | `getSigma()` Returns the parameter σ of this object.
`static double` | `nextDouble(RandomStream s, double mu, double sigma)` Generates a variate from the normal distribution with parameters μ = `mu` and σ = `sigma`, 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

### NormalGen

    public NormalGen(RandomStream s,
                     double mu,
                     double sigma)

  Creates a normal random variate generator with mean `mu` and standard deviation `sigma`, using stream `s`.

### NormalGen

    public NormalGen(RandomStream s)

  Creates a standard normal random variate generator with mean `0` and standard deviation `1`, using stream `s`.

### NormalGen

    public NormalGen(RandomStream s,
                     NormalDist dist)

  Creates a random variate generator for the normal distribution `dist` and stream `s`.

Method Detail

### nextDouble

    public static double nextDouble(RandomStream s,
                                    double mu,
                                    double sigma)

  Generates a variate from the normal distribution with parameters μ = `mu` and σ = `sigma`, using stream `s`.

### getMu

    public double getMu()

  Returns the parameter μ of this object.

### getSigma

    public double getSigma()

  Returns the parameter σ of this object.

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.