SSJ
V. 2.6.

umontreal.iro.lecuyer.randvar
Class HalfNormalGen

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

public class HalfNormalGen
extends RandomVariateGen

This class implements methods for generating random variates from the half-normal distribution with parameters μ and σ > 0. Its density is

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


Constructor Summary
HalfNormalGen(RandomStream s, double mu, double sigma)
          Creates a new half-normal generator with parameters μ = mu and σ = sigma, using stream s.
HalfNormalGen(RandomStream s, HalfNormalDist 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 half-normal distribution with parameters μ = mu and σ = sigma, 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

HalfNormalGen

public HalfNormalGen(RandomStream s,
                     double mu,
                     double sigma)
Creates a new half-normal generator with parameters μ = mu and σ = sigma, using stream s.


HalfNormalGen

public HalfNormalGen(RandomStream s,
                     HalfNormalDist 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 half-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 HalfNormal 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

SSJ
V. 2.6.

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