SSJ
V. labo.

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

HalfNormalGen

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

f (x) = ($\displaystyle \sqrt{{2/\pi}}$/σ)e-(x-μ)2/(2σ2),        for x > = μ,


Constructor Summary
HalfNormalGen(RandomStream s, double mu, double sigma)
          .
HalfNormalGen(RandomStream s, HalfNormalDist dist)
          .
 
Method Summary
 double getMu()
          .
 double getSigma()
          .
static double nextDouble(RandomStream s, double mu, double sigma)
          .
 
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)
. \begin{tabb}Creates a new {\em half-normal} generator with parameters $\mu =$
 \texttt{mu} and $\sigma =$\ \texttt{sigma}, using stream \texttt{s}.
 \end{tabb}


HalfNormalGen

public HalfNormalGen(RandomStream s,
                     HalfNormalDist dist)
. \begin{tabb}Creates a new generator for the distribution \texttt{dist},
 using stream \texttt{s}.
 \end{tabb}

Method Detail

nextDouble

public static double nextDouble(RandomStream s,
                                double mu,
                                double sigma)
. \begin{tabb}Generates a variate from the {\em half-normal\/} distribution with
 ...
 ...\texttt{mu} and $\sigma = $~\texttt{sigma},
 using stream \texttt{s}.
 \end{tabb}
sthe random stream muthe parameter mu sigmathe parameter sigma Generates a variate from the HalfNormal distribution


getMu

public double getMu()
. \begin{tabb}Returns the parameter $\mu$\ of this object.
 \end{tabb}
the parameter mu


getSigma

public double getSigma()
. \begin{tabb}Returns the parameter $\sigma$\ of this object.
 \end{tabb}
the parameter mu


SSJ
V. labo.

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