Class PdfContGaussianZiggurat

  • All Implemented Interfaces:
    Pdf, PdfCont

    public class PdfContGaussianZiggurat
    extends Object
    implements PdfCont
    This routine is based on the following article, with a couple of modifications which simplify the implementation. George Marsaglia, Wai Wan Tsang The Ziggurat Method for Generating Random Variables Journal of Statistical Software, vol. 5 (2000), no. 8 http://www.jstatsoft.org/v05/i08/ The modifications are: 1) use 128 steps instead of 256 to decrease the amount of static data necessary. 2) use an acceptance sampling from an exponential wedge exp(-R*(x-R/2)) for the tail of the base strip to simplify the implementation. The area of exponential wedge is used in calculating 'v' and the coefficients in ziggurat table, so the coefficients differ slightly from those in the Marsaglia and Tsang paper. See also Leong et al, "A Comment on the Implementation of the Ziggurat Method", Journal of Statistical Software, vol 5 (2005), no 7.
    Author:
    osborn
    • Constructor Detail

      • PdfContGaussianZiggurat

        public PdfContGaussianZiggurat​(double mean,
                                       double stdev)
    • Method Detail

      • draw

        public double draw​(Generator g)
        Description copied from interface: PdfCont
        Returns a random draw from this PDF using the provided StochasticEngine.Generator object.
        Specified by:
        draw in interface PdfCont
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object