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 FoldedNormalGen

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

    public class FoldedNormalGen

extends RandomVariateGen

This class implements methods for generating random variates from the folded normal distribution with parameters μ >= 0 and σ > 0. The density is

f (x) = φ((x - μ/)σ) + φ((- x - μ)/σ) for x >= 0,

where φ denotes the density function of a standard normal distribution.

Constructor Summary
`FoldedNormalGen(RandomStream s, double mu, double sigma)` Creates a new folded normal generator with parameters μ = `mu` and σ = `sigma`, using stream `s`.
`FoldedNormalGen(RandomStream s, FoldedNormalDist dist)` Creates a new generator for the distribution `dist`, using 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 folded 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

### FoldedNormalGen

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

  Creates a new folded normal generator with parameters μ = `mu` and σ = `sigma`, using stream `s`.

### FoldedNormalGen

    public FoldedNormalGen(RandomStream s,
                           FoldedNormalDist dist)

  Creates a new generator for the distribution `dist`, using stream `s`.

Method Detail

### nextDouble

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

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

  Parameters:
    `s` - the random stream
    `mu` - the parameter mu
    `sigma` - the parameter sigma
  Returns:
    Generates a variate from the FoldedNormal distribution

### getMu

    public double getMu()

  Returns the parameter μ of this object.

  Returns:
    the parameter mu

### getSigma

    public double getSigma()

  Returns the parameter σ of this object.

  Returns:
    the parameter mu

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.