Home
SSJ User's Guide Package randvar Generating Non
Contents
1. package umontreal iro lecuyer randvar public class LogarithmicGen extends RandomVariateGenInt Constructors public LogarithmicGen RandomStream s LogarithmicDist dist Creates a new generator with distribution dist and stream s with default value 04 0 96 public LogarithmicGen RandomStream s LogarithmicDist dist double theta0 Creates a new generator with distribution dist and stream s with 09 theta0 Methods public static int nextInt RandomStream s double theta Uses stream s to generate a new variate from the logarithmic distribution with parameter 0 theta 2 From Pierre Does this work for any 04 Should we add constraints 13 NegativeBinomialGen This class implements random variate generators having the negative binomial distribution Its mass function is n Fora for x 0 1 5 wheren gt 1land0 lt p lt l No local copy of the parameters n and p is maintained in this class The non static nextInt method simply calls inverseF on the distribution package umontreal iro lecuyer randvar public class NegativeBinomialGen extends RandomVariateGenInt Constructors public NegativeBinomialGen RandomStream s NegativeBinomialDist dist Creates a new generator for the distribution dist using stream s Methods public static int nextInt RandomStream s int n double p Generates a new variate from the negative binomial distribution with parameters n n and p p using str
2. public class ErlangConvolutionGen extends ErlangGen Constructors public ErlangConvolutionGen RandomStream s ErlangDist dist Creates a new generator for the distribution dist and stream s 30 ExponentialGen This class implements random variate generators for the exponential distribution The den sity is HE for x gt 0 14 where A gt 0 No local copy of the parameter A is maintained in this class The non static nextDouble method simply calls inverseF on the distribution package umontreal iro lecuyer randvar public class ExponentialGen extends RandomVariateGen Constructors public ExponentialGen RandomStream s ExponentialDist dist Creates a new generator for the exponential distribution dist and stream s Methods public static double nextDouble RandomStream s double lambda Uses inversion to generate a new exponential variate with parameter A lambda using stream s 31 ExtremeValueGen This class implements random variate generators for the Gumbel or extreme value distri bution Its density is f z Ae Ma for x gt 0 15 where gt 0 No local copy of the parameters a and A is maintained in this class The non static nextDouble method simply calls inverseF on the distribution package umontreal iro lecuyer randvar public class ExtremeValueGen extends RandomVariateGen Constructors public ExtremeValueGen RandomStream s ExtremeValueDist dist Creates a new
3. nextDouble method simply calls inverseF on the distribution package umontreal iro lecuyer randvar public class LogisticGen extends RandomVariateGen Constructors public LogisticGen RandomStream s LogisticDist dist Creates a new generator for the logistic distribution dist and stream s Methods public static double nextDouble RandomStream s double alpha double lambda Generates a new variate from the logistic distribution with parameters a alpha and A lambda using stream s 44 LoglogisticGen This class implements random variate generators for the Log Logistic distribution with shape parameter a gt 0 and scale parameter 8 gt 0 The density function of this distribution is a e 8 BL 2 8 0 for x gt 0 27 package umontreal iro lecuyer randvar public class LoglogisticGen extends RandomVariateGen Constructors public LoglogisticGen RandomStream s LoglogisticDist dist Creates a new generator for the distribution dist using stream s Methods public static double nextDouble RandomStream s double alpha double beta Generates a variate from the Log Logistic distribution with shape parameter a gt 0 and scale parameter P gt 0 45 LognormalGen This class implements methods for generating random variates from the lognormal distribu tion Its density is 1 f x EA for x gt 0 28 where g gt 0 No local copy of the parameters y and is maintained in
4. public FisherFGen RandomStream s FisherFDist dist Creates a new generator for the distribution dist using stream s Methods public static double nextDouble RandomStream s int n int m Generates a variate from the Fisher F distribution with n and m degrees of freedom using stream s 34 GammaGen This class implements random variate generators for the gamma distribution Its parameters are a gt 0 and A gt 0 Its density function is f x Arte 1 a for z gt 0 18 where is the gamma function defined by Tr a i te dr 19 0 No local copy of the parameters a and A is maintained in this class The non static nextDouble method simply calls inverseF on the distribution package umontreal iro lecuyer randvar public class GammaGen extends RandomVariateGen Constructors public GammaGen RandomStream s GammaDist dist Creates a new generator object for the gamma distribution dist and stream s Methods public static double nextDouble RandomStream s double alpha double lambda Generates a new gamma random variate with parameters alpha and A lambda using stream s 35 GammaAcceptanceRejectionGen This class implements gamma random variate generators using a method that combines acceptance rejection with acceptance complement and proposed in 1 3 It uses acceptance rejection for a lt 1 and acceptance complement for a gt 1 For each gamma variate the first uniform req
5. EmpiricalDist dist Computes and returns the value of ho in 23 public void setBandwidth double h Sets the bandwidth to h public void setPositiveReflection boolean reflect After this method is called with true the generator will produce only positive values by using the reflection method replace all negative values by their absolute values That is nextDouble will return x if x is the generated variate The mecanism is disabled when the method is called with false 41 KernelDensity VarCorrectGen This class is a variant of KernelDensityGen but with a rescaling of the empirical distribution so that the variance of the density used to generate the random variates is equal to the empirical variance as suggested by 27 Let Zn and s be the sample mean and sample variance of the observations The dis tance between each generated random variate and the sample mean Z is multiplied by the correcting factor 1 o where 0 1 ho s The constant o must be passed to the constructor Its value can be found in Table 1 for some popular kernels package umontreal iro lecuyer randvar public class KernelDensityVarCorrectGen extends KernelDensityGen Constructors public KernelDensityVarCorrectGen RandomStream s EmpiricalDist dist RandomVariateGen kGen double h double sigmak2 Creates a new generator for a kernel density estimated from the observations given by the empirical distribution dist using stream s to s
6. RandomStream s BetaDist dist Same as BetaRejectionLoglogisticGen s s dist The auxiliary stream used will be the same as the main stream Methods public RandomStream getAuxStream Returns the auxiliary stream associated with that object 20 BetaStratifiedRejectionGen This class implements Beta random variate generators using the stratified rejection patchwork rejection method from 26 28 This method draws one uniform from the main stream and uses the auxiliary stream for any additional uniform variates that might be needed package umontreal iro lecuyer randvar public class BetaStratifiedRejectionGen extends BetaGen Constructors public BetaStratifiedRejectionGen RandomStream s RandomStream aux BetaDist dist Creates a new generator for the distribution dist using the given stream s and auxiliary stream aux The auxiliary stream is used when a random number of variates must be drawn from the main stream public BetaStratifiedRejectionGen RandomStream s BetaDist dist Same as BetaStratifiedRejectionGen s s dist The auxiliary stream used will be the same as the main stream Methods public RandomStream getAuxStream Returns the auxiliary stream associated with this object 21 BetaSymmetricalGen This class implements random variate generators with the symmetrical beta distribution with shape parameters a 5 over the interval 0 1 package umontreal iro lecuyer randvar publi
7. stream s Methods public static int nextInt RandomStream s int n double p Generates a new integer from the binomial distribution with parameters n n and p p using the given stream s BinomialConvolutionGen Implements binomial random variate generators using the convolution method This method generates n Bernouilli random variates with parameter p and adds them up Its advantages are that it requires little computer memory and no setup time Its disadvantage is that it is very slow for large n It makes sense only when n is small A local copy of the parameters n and p is maintained in this class package umontreal iro lecuyer randvar public class BinomialConvolutionGen extends BinomialGen Constructors public BinomialConvolutionGen RandomStream s BinomialDist dist Creates a new random variate generator for distribution dist and stream s 10 GeometricGen This class implements a random variate generator for the geometric distribution Its has parameter p and mass function p x p l p for 0 1 2 2 where 0 lt p lt 1 Random variates are generated by calling inversion on the distribution object package umontreal iro lecuyer randvar public class GeometricGen extends RandomVariateGenInt Constructors public GeometricGen RandomStream s GeometricDist dist Creates a new generator for the distribution dist using stream s Methods public static int nextInt RandomStrea
8. 29 17 18 19 input In J A Joines R R Barton K Kang and P A Fishwick editors Proceedings of the 2000 Winter Simulation Conference pages 675 682 Pistacaway NJ Dec 2000 IEEE Press W Hormann J Leydold and G Derflinger Automatic Nonuniform Random Variate Generation Springer Verlag Berlin 2004 N L Johnson S Kotz and N Balakrishnan Continuous Univariate Distributions volume 1 Wiley 2nd edition 1994 N L Johnson S Kotz and N Balakrishnan Continuous Univariate Distributions volume 2 Wiley 2nd edition 1995 V Kachitvichyanukul and B Schmeiser Computer generation of hypergeometric ran dom variates J Statist Comput Simul 22 127 145 1985 A W Kemp Efficient generation of logarithmically distributed pseudo random vari ables Applied Statistics 30 249 253 1981 A J Kinderman and J G Ramage Computer generation of normal random variables Journal of the American Statistical Association 71 893 898 1976 A M Law and W D Kelton Simulation Modeling and Analysis McGraw Hill New York NY third edition 2000 J Leydold and W H rmann UNURAN A Library for Universal Non Uniform Ran dom Number Generators 2002 Available at http statistik wu wien ac at unuran G Marsaglia Improving the polar method for generating a pair of random variables Technical report Boeing Scientific Research Laboratory Seattle Washington 1962 H Sakasegawa St
9. caching is turned OFF the nextDouble method simply calls the corresponding method on the internal random variate generator without storing the generated values public void setCaching boolean caching Sets the caching indicator to caching If caching is turned OFF this method calls clearCache to clear the cached values public RandomVariateGen getCachedGen Returns a reference to the random variate generator whose values are cached public void setCachedGen RandomVariateGen rvg Sets the random variate generator whose values are cached to rvg If the generator is changed the clearCache method is called RandomVariateGenWithCache 7 public void clearCache Clears the cached values for this cached generator Any subsequent call will then obtain new values from the internal generator public void initCache Resets this generator to recover values from the cache Subsequent calls to nextDouble will return the cached random values until all the values are returned When the array of cached values is exhausted the internal random variate generator is used to generate new values which are added to the internal array as well This method is equivalent to calling setCacheIndex public int getNumCachedValues Returns the total number of values cached by this generator public int getCacheIndex Return the index of the next cached value that will be returned by the generator If the cache is exhausted the returned value
10. corresponds to the value returned by getNumCachedValues and a subsequent call to nextDouble will generate a new variate rather than reading a previous one from the cache If caching is disabled this always returns 0 public void setCacheIndex int newIndex Sets the index in the cache of the next value returned by nextDouble If newIndex is 0 this is equivalent to calling initCache If newIndex is getNumCachedValues subsequent calls to nextDouble will add new values to the cache public DoubleArrayList getCachedValues Returns an array list containing the values cached by this random variate generator public void setCachedValues DoubleArrayList values Sets the array list containing the cached values to values This resets the cache index to the size of the given array BinomialGen This class implements random variate generators for the binomial distribution It has pa rameters n and p with mass function n zx n __ n n x pte p 1 p aga for z 0 1 2 a 1 where n is a positive integer and 0 lt p lt 1 No local copy of the parameters n and p is maintained in this class The non static nextInt method simply calls inverseF on the distribution package umontreal iro lecuyer randvar public class BinomialGen extends RandomVariateGenInt Constructors public BinomialGen RandomStream s BinomialDist dist Creates a new random variate generator for the binomial distribution dist and the random
11. distribution In L C A Corsten and J Hermans editors COMPSTAT 1978 Proceedings in Computational statistics pages 341 347 Vienna 1978 Physica Verlag G E P Box and M E Muller A note on the generation of random normal deviates Annals of Mathematical Statistics 29 610 611 1958 R Cao A Cuevas and W Gonz lez Manteiga A comparative study of several smoothing methods for density estimation Computational Statistics and Data Analysis 17 153 176 1994 R C H Cheng The generation of gamma variables with non integral shape parameter Applied Statistics 26 71 75 1977 R C H Cheng Generating beta variates with nonintegral shape parameters Com munications of the ACM 21 317 322 1978 L Devroye Non Uniform Random Variate Generation Springer Verlag New York NY 1986 L Devroye Random variate generation in one line of code In Proceedings of the 1996 Winter Simulation Conference pages 265 271 IEEE Press 1996 L Devroye and L Gyorfi Nonparametric Density Estimation The L View John Wiley New York NY 1985 J E Gentle Random Number Generation and Monte Carlo Methods Springer New York NY 1998 REFERENCES 65 15 W H ermann and G Derflinger The ACR method for generating normal random variables OR Spektrum 12 181 185 1990 16 W H rmann and J Leydold Automatic random variate generation for simulation 20 21 22 23 24 25 26 27 28
12. is apre forg Sp Ma 0 for lt P en The non static nextDouble method simply calls inverseF on the distribution package umontreal iro lecuyer randvar public class ParetoGen extends RandomVariateGen Constructors public ParetoGen RandomStream s ParetoDist dist Creates a new generator for the Pareto distribution dist and stream s Methods public static double nextDouble RandomStream s double alpha double beta Generates a new variate from the Pareto distribution with parameters a alpha and ff beta using stream s 53 Pearson5Gen This class implements random variate generators for the Pearson type V distribution with shape parameter a gt 0 and scale parameter 4 gt 0 The density function of this distribution is a 1 8 2 o for x gt 0 f x PreT a 31 0 otherwise where I is the gamma function package umontreal iro lecuyer randvar public class PearsondGen extends RandomVariateGen Constructors public Pearson5Gen RandomStream s Pearson5Dist dist Creates a new generator for the distribution dist using stream s Methods public static double nextDouble RandomStream s double alpha double beta Generates a variate from the Pearson V distribution with shape parameter a gt 0 and scale parameter P gt 0 54 Pearson6Gen This class implements random variate generators for the Pearson type VI distribution with shape parameters a gt 0 and ag gt 0 and scal
13. random number stream 63 UnuranException This type of unchecked exception is thrown when an error occurs inside the UNURAN package Usually such an exception will come from the native side package umontreal iro lecuyer randvar public class UnuranException extends RuntimeException Constructors public UnuranException Constructs a new generic UNURAN exception public UnuranException String message Constructs a UNURAN exception with the error message message REFERENCES 64 References 1 J H Ahrens and U Dieter Computer methods for sampling from gamma beta poisson and bionomial distributions Computing 12 223 246 1972 2 J H Ahrens and U Dieter Computer generation of poisson deviates from modified normal distributions ACM Trans Math Software 8 163 179 1982 3 J H Ahrens and U Dieter Generating gamma variates by a modified rejection tech nique Communications of the ACM 25 47 54 1982 4 R W Bailey Polar generation of random variates with the t distribution Mathematics of Computation 62 206 779 781 1994 5 A Berlinet and L Devroye A comparison of kernel density estimates Publications 10 11 12 13 14 de l Institut de Statistique de l Universit de Paris 38 3 3 59 1994 available at http cgm cs mcgill ca luc np html D J Best A simple algorithm for the computer generation of random samples from a Student s t or symmetric beta
14. stream s2 generates y see eq 9 Restriction a gt 1 2 public static double nextDouble RandomStream s double alpha Generates a random number using Ulrich s polar method with only one stream s Restriction a gt 1 2 public RandomStream getStream2 Returns stream s2 associated with this object 23 BetaSymmetricalBestGen This class implements symmetrical beta random variate generators using Devroye s one liner method It is based on Best s relation 6 between a Student t variate and a symmetrical beta variate L 1 Ta Bsa 1 gt ae If S is a random sign and U U2 are two independent uniform 0 1 random variates then the following gives a symmetrical beta variate 12 gl S Baa 5 1 ds f 0791 cos 27U2 valid for any shape parameter a gt 0 10 package umontreal iro lecuyer randvar public class BetaSymmetricalBestGen extends BetaSymmetricalGen Constructors public BetaSymmetricalBestGen RandomStream stream RandomStream s2 RandomStream s3 BetaSymmetricalDist dist Creates a new generator for the distribution dist using stream stream to generate Uj stream s2 to generate U2 and stream s3 to generate S as given in equation 10 public BetaSymmetricalBestGen RandomStream stream BetaSymmetricalDist dist Creates a new generator for the distribution dist using only one stream stream Methods public static double nextDouble RandomStream s1 RandomStream s
15. this class The non static nextDouble method simply calls inverseF on the lognormal distribution object One can also generate a lognormal random variate X via X Math exp NormalGen nextDouble s mu sigma in which NormalGen can actually be replaced by any subclass of NormalGen package umontreal iro lecuyer randvar public class LognormalGen extends RandomVariateGen Constructors public LognormalGen RandomStream s LognormalDist dist Create a random variate generator for the lognormal distribution dist and stream s Methods public static double nextDouble RandomStream s double mu double sigma Generates a new variate from the lognormal distribution with parameters y mu and o sigma using stream s 46 LognormalSpecialGen Implements methods for generating random variates from the lognormal distribution using an arbitrary normal random variate generator The non static nextDouble method calls the nextDouble method of the normal generator and takes the exponential of the result package umontreal iro lecuyer randvar public class LognormalSpecialGen extends RandomVariateGen Constructors public LognormalSpecialGen NormalGen g Create a lognormal random variate generator using the normal generator g and with the same parameters AT NormalGen This class implements methods for generating random variates from the normal distribution N p 0 It has mean p and variance 0 where o gt 0 Its de
16. which the observations come The resulting kernel density has the general form fala Do 0 1 22 where k is a fixed pre selected density called the kernel and h is a positive constant called the bandwidth or smoothing factor A difficult practical issue is the selection of k and h Several approaches have been proposed for that see e g 27 The constructor of a generator from a kernel density requires a random stream s the n observations in the form of an empirical distribution a random variate generator for the kernel density k and the value of the bandwidth h The random variates are then generated as follows select an observation x at random by inversion using stream s then generate random variate Y with the generator provided for the density k and return x AY A simple formula for the bandwidth suggested in 17 is h ax ho where ho 1 36374 min s q 1 34Jn7YP 23 Sn and q are the empirical standard deviation and the interquartile range of the n observa tions and a is a constant that depends on the type of kernel k It is defined by ak lt i f k de k 24 where dj is the standard deviation of the density k The static method getBaseBandwidth permits one to compute ho for a given empirical distribution Table 1 Some suggested kernels name constructor Qk a efficiency Epanechnikov BetaSymmetricDist 2 0 1 0 1 0 1 7188 1 5 1 000 triangular TriangularDist 1 0 1 0 0 0 1 8882 1 6 0 986 G
17. 2 RandomStream s3 double alpha Generates a random number using Devroye s one liner method Restriction a gt 0 public static double nextDouble RandomStream s double alpha Generates a random number using Devroye s one liner method with only one stream s Restriction a gt 0 public RandomStream getStream2 Returns stream s2 associated with this object public RandomStream getStream3 Returns stream s3 associated with this object 24 CauchyGen This class implements random variate generators for the Cauchy distribution The density is see e g 18 p 299 A or 00 x 00 Mt ea f lt T lt 11 where P gt 0 No local copy of the parameters a and is maintained in this class The non static nextDouble method simply calls inverseF on the distribution package umontreal iro lecuyer randvar public class CauchyGen extends RandomVariateGen Constructors public CauchyGen RandomStream s CauchyDist dist Create a new generator for the distribution dist using stream s Methods public static double nextDouble RandomStream s double alpha double beta Generates a new variate from the Cauchy distribution with parameters a alpha and b beta using stream s 25 ChiGen This class implements random variate generators for the chi distribution It has y gt 0 degrees of freedom and its density function is see 18 page 417 en 2 2p 1 f x WATO for x gt Q 12 where
18. I x is the gamma function defined in 19 No local copy of the parameter v is maintained in this class The non static nextDouble method simply calls inverseF on the distribution slow package umontreal iro lecuyer randvar public class ChiGen extends RandomVariateGen Constructors public ChiGen RandomStream s ChiDist dist Create a new generator for the distribution dist using stream s Methods public static double nextDouble RandomStream s int nu Generates a random variate from the chi distribution with y nu degrees of freedom using stream s 26 ChiRatioOfUniformsGen This class implements Chi random variate generators using the ratio of uniforms method with shift A local copy of the parameter y is maintained in this class package umontreal iro lecuyer randvar public class ChiRatio0fUniformsGen extends ChiGen Constructors public ChiRatio0fUniformsGen RandomStream s ChiDist dist Create a new generator for the distribution dist using stream s 27 ChiSquareGen This class implements random variate generators with the chi square distribution with n gt 0 degrees of freedom Its density function is e72 29n 2 1 Ha PE n D for x gt 0 13 where I x is the gamma function defined in 19 No local copy of the parameter n is maintained in this class The non static nextDouble method simply calls inverseF on the distribution package umontreal iro lecuyer randvar p
19. Local copies of the parameters a 3 a and b are maintained in this class The non static nextDouble method simply calls inverseF on the distribution package umontreal iro lecuyer randvar public class BetaGen extends RandomVariateGen Constructors public BetaGen RandomStream s BetaDist dist Creates a new generator for the distribution dist using stream s Methods public static double nextDouble RandomStream s double alpha double beta double a double b Generates a variate from the beta distribution with parameters a alpha 3 beta over the interval a b using stream s 19 BetaRejectionLoglogisticGen Implements Beta random variate generators using the rejection method with log logistic envelopes from 10 The method draws the first two uniforms from the main stream and uses the auxiliary stream for the remaining uniforms when more than two are needed i e when rejection occurs The current implementation is adapted from UNURAN package umontreal iro lecuyer randvar public class BetaRejectionLoglogisticGen extends BetaGen Constructors public BetaRejectionLoglogisticGen RandomStream s RandomStream aux BetaDist dist Creates a new generator for the distribution dist using stream s and auxiliary stream aux The main stream is used for the first uniforms before a rejection occurs and the auxiliary stream is used afterwards after the first rejection public BetaRejectionLoglogisticGen
20. SSJ User s Guide Package randvar Generating Non Uniform Random Numbers Version May 21 2008 This package implements random number generators from various standard distributions It also provides an interface to the C package UNURAN CONTENTS Contents E eg ec ee ee ge meee eae ass asa ee Bee a ee eras ee ee ee ee ee ee ee ee E oa ee See ee ee ee ee ee ee Generators for Discrete Distributions over the Integers td dhe ERA Aaa BinomialConvolutionGen aoa a a a a a a a ee A ee ee ee ee os e te HypergeometricG en as u at de Gee ae Gees RE eee EE we REE eS LogarithmicGen os wa hey err ss Wie eee e a we ee NegativeBinomialGen 226 n6 oh eae eS ed oY AS OPE MES HERE ES PascalConvolutionGen eee eR Re eR ee ee ee Mf Me es to wes es ES os ee Gs he ey es ee ey a ee PoissonTIACGen ca eaae paa e e ea ee UniformIntGen se se co neema meeen rp ee Generators for Continuous Distributions a ee e ce a at a dad daa aaa o Gee oe peed eae oa o ao E A a a ee e Ur A Sates Has Pe hee es fe pa ho ooh knee oe heehee ai ee ae eS i ao of A 00 CONTENTS 1 Da A ea aa Mc dd ci 31 Fatig eLiteG Gen s oo edo a la BEG o e Bese d 32 pi a a e Rs al Gree a a id e o 33 o pp and ad Ye Ad pe a A Be 34 A ee A A 35 e o ad 36 he sos a a aes 37 eee OE OE OD OEE A EME REDE RE GH 38 ee ede is ng es es ee eee 39 A 41 Aia ra AAA 42 tr a Ses A A RIA ee 43 a kbs Skee Se a ee de tdo a es 44 ba
21. a double delta Uses inversion to generate a new variate from the Weibull distribution with parameters qa alpha lambda and 6 delta using stream s 60 UnuranContinuous This class permits one to create continuous univariate distribution using UNURAN via its string API package umontreal iro lecuyer randvar public class UnuranContinuous extends RandomVariateGen Constructors public UnuranContinuous RandomStream s String genStr Same as UnuranContinuous s s genStr public UnuranContinuous RandomStream s RandomStream aux String genStr Constructs a new continuous random number generator using the UNURAN generator spec ification string genStr main stream s and auxiliary stream aux Methods public RandomStream getAuxStream Returns the auxiliary random number stream 61 UnuranDiscretelnt This class permits one to create a discrete univariate distribution using UNURAN via its string API package umontreal iro lecuyer randvar public class UnuranDiscretelnt extends RandomVariateGenInt Constructors public UnuranDiscreteInt RandomStream s String genStr Same as UnuranDiscretelnt s s genStr public UnuranDiscreteInt RandomStream s RandomStream aux String genStr Constructs a new discrete random number generator using the UNURAN generator specifi cation string genStr main stream s and auxiliary stream aux Methods public RandomStream getAuxStream Returns the auxiliar
22. am used by this generator public void setStream RandomStream stream Sets the RandomStream used by this generator to stream public Distribution getDistribution Returns the Distribution used by this generator RandomVariateGenInt This is the base class for all generators of discrete random variates over the set of integers Similar to RandomVariateGen except that the generators produce integers via the nextInt method instead of real numbers package umontreal iro lecuyer randvar public class RandomVariateGenInt extends RandomVariateGen Constructor public RandomVariateGenInt RandomStream s DiscreteDistributionInt dist Creates a new random variate generator for the discrete distribution dist using stream s Methods public int nextInt Generates a random number an integer from the discrete distribution contained in this object By default this method uses inversion by calling the inverseF method of the distribution object Alternative generating methods are provided in subclasses public void nextArrayOfInt int v int start int n Generates n random numbers from the discrete distribution contained in this object The results are stored into the array v starting from index start By default this method calls nextInt n times but one can reimplement it in subclasses for better efficiency RandomVariateGenWithCache This class represents a random variate generator whose values are cached for more effi
23. aussian NormalDist 0 7764 1 0 951 boxcar UniformDist 1 0 1 0 13510 1 3 0 930 logistic LogisticDist 0 4340 3 2899 0 888 Student t 3 StudentDist 3 0 0 4802 3 0 674 Table 1 gives the precomputed values of cy and a for selected popular kernels The values are taken from 17 The second column gives the name of a function in this package KernelDensityGen 40 that constructs the corresponding distribution The efficiency of a kernel is defined as the ratio of its mean integrated square error over that of the Epanechnikov kernel which has optimal efficiency and corresponds to the beta distribution with parameters 2 2 over the interval 1 1 package umontreal iro lecuyer randvar public class KernelDensityGen extends RandomVariateGen Constructors public KernelDensityGen RandomStream s EmpiricalDist dist RandomVariateGen kGen double h Creates a new generator for a kernel density estimated from the observations given by the empirical distribution dist using stream s to select the observations generator kGen to generate the added noise from the kernel density and bandwidth h public KernelDensityGen RandomStream s EmpiricalDist dist NormalGen kGen This constructor uses a gaussian kernel and the default bandwidth h ax hy with the az suggested in Table 1 for the gaussian distribution This kernel has an efficiency of 0 951 Kernel selection and parameters public static double getBaseBandwidth
24. bution see PoissonGen Uses the tabulated inversion combined with acceptance complement TIAC method of 2 The implementation is adapted from UNURAN 24 A local copy of the parameter lambda is maintained in this class package umontreal iro lecuyer randvar public class PoissonTIACGen extends PoissonGen Constructor public PoissonTIACGen RandomStream s PoissonDist dist Creates a new random variate generator using the Poisson distribution dist and stream s 17 UniformIntGen This class implements a random variate generator for the uniform distribution over integers over the interval fi 7 Its mass function is 1 and 0 elsewhere package umontreal iro lecuyer randvar public class UniformIntGen extends RandomVariateGenInt Constructors public UniformIntGen RandomStream s UniformIntDist dist Creates a new generator for the distribution dist using stream s Methods public static int nextInt RandomStream s int i int j Generates a new uniform random variate over the interval fi j using stream s by inversion 18 BetaGen This class implements random variate generators with the beta distribution with shape pa rameters a gt 0 and 8 gt 0 over the interval a b where a lt b The density function of this distribution is Tr a B Maj 8 0 ajer 1 x a ba fora lt z lt b 8 fu and f x 0 elsewhere where F x is the gamma function defined in 19
25. c class BetaSymmetricalGen extends BetaGen Constructors public BetaSymmetricalGen RandomStream s BetaSymmetricalDist dist Creates a new generator for the distribution dist using stream s Methods public static double nextDouble RandomStream s double alpha 22 BetaSymmetricalPolarGen This class implements symmetrical beta random variate generators using Ulrich s polar method 29 The method generates two uniform random variables x 0 1 and y 1 1 until 1 y lt 1 Then it returns 1 Ty 4 9 1 892 20 1 9 2 3 0 where S 2 y and o is the shape parameter of the beta distribution The method is valid only when a gt 1 2 package umontreal iro lecuyer randvar public class BetaSymmetricalPolarGen extends BetaSymmetricalGen Constructors public BetaSymmetricalPolarGen RandomStream stream RandomStream s2 BetaSymmetricalDist dist Creates a new generator for the distribution dist using stream stream to generate x and stream s2 to generate y as described in eq 9 above Restriction dist must have a gt 1 2 public BetaSymmetricalPolarGen RandomStream stream BetaSymmetricalDist dist Creates a new generator for the distribution dist using only one stream stream Restric tion dist must have a gt 1 2 Methods public static double nextDouble RandomStream si RandomStream s2 double alpha Generates a random number using Ulrich s polar method Stream s1 generates x and
26. ciency when using common random numbers An object from this class is constructed with a reference to a RandomVariateGen instance used to get the random numbers These numbers are stored in an internal array to be retrieved later The dimension of the array increases as the values are generated If the nextDouble method is called after the object is reset it gives back the cached values instead of computing new ones If the cache is exhausted before the generator is reset new values are computed and added to the cache Such caching allows for a better performance with common random numbers when gener ating random variates is time consuming However using such caching may lead to memory problems if a large quantity of random numbers are needed package umontreal iro lecuyer randvar public class RandomVariateGenWithCache extends RandomVariateGen Constructors public RandomVariateGenWithCache RandomVariateGen rvg Constructs a new cached random variate generator with internal generator rvg public RandomVariateGenWithCache RandomVariateGen rvg int initialCapacity Constructs a new cached random variate generator with internal generator rvg The initialCapacity parameter is used to set the initial capacity of the internal array which can grow as needed it does not limit the maximal number of cached values Methods public boolean isCaching Determines if the random variate generator is caching values default being true When
27. e by default the same stream will be used for all uniforms The generic classes RandomVariateGen and RandomVariateGenInt permit one to con struct a random variate generator from a random stream and an arbitrary distribution from the package Distribution To generate random variates by inversion from an arbitrary distribution over the real numbers using a given random stream one can con struct a RandomVariateGen object with the desired previously created Distribution and RandomStream objects and then call its nextDouble method For discrete distributions over the integers one can construct a RandomVariateGenInt object that contains the desired DiscreteDistributionInt and RandomStream and call its nextInt method By default these generators simply call the inverseF method from the specified distribution object To generate random variates by other methods than inversion one can use specialized classes that extend RandomVariateGen or RandomVariateGenInt Such classes are provided for a variety of standard discrete and continuous distributions For example NormalGen extends RandomVariateGen and provides normal random variate generators based on inver sion Subclasses of NormalGen implement various non inversion normal variate generation methods To generate random variates with a specific method it suffices to invoke the constructor of the appropriate subclass and then call its nextDouble method In most cases the specialized classes mai
28. e parameter 6 gt 0 The density function of this distribution is 2 87 f a Baroli gt 32 0 otherwise where B is the beta function package umontreal iro lecuyer randvar public class Pearson6Gen extends RandomVariateGen Constructors public Pearson6Gen RandomStream s Pearson6Dist dist Creates a new generator for the distribution dist using stream s Methods public static double nextDouble RandomStream s double alphal double alpha2 double beta Generates a variate from the Pearson VI distribution with shape parameters a gt 0 and a2 gt 0 and scale parameter 4 gt 0 55 StudentGen This class implements methods for generating random variates from the Student distribution with n gt 0 degrees of freedom Its density function is n M2 ayra where I x is the gamma function defined in 19 T n 1 2 f a ee for 00 lt lt o0 33 No local copy of the parameter n is maintained in this class The non static nextDouble method simply calls inverseF on the distribution package umontreal iro lecuyer randvar public class StudentGen extends RandomVariateGen Constructors public StudentGen RandomStream s StudentDist dist Creates a new generator for the Student distribution dist and stream s Methods public static double nextDouble RandomStream s int n Generates a new variate from the Student distribution with n n degrees of freedom using strea
29. eam s 14 PascalConvolutionGen Implements Pascal random variate generators by the convolution method see 23 The method generates n geometric variates with probability p and adds them up The algorithm is slow if n is large A local copy of the parameters n and p is maintained in this class package umontreal iro lecuyer randvar public class PascalConvolutionGen extends NegativeBinomialGen Constructors public PascalConvolutionGen RandomStream s PascalDist dist Creates a new generator for the distribution dist using stream s 15 PoissonGen This class implements random variate generators having the Poisson distribution Its mass function is ETAN plx for x 0 1 6 x where A gt 0 is a real valued parameter equal to the mean No local copy of the parameter A lambda is maintained in this class The non static nextInt method simply calls inverseF on the distribution package umontreal iro lecuyer randvar public class PoissonGen extends RandomVariateGenInt Constructor public PoissonGen RandomStream s PoissonDist dist Creates a new random variate generator using the Poisson distribution dist and stream s Methods public static int nextInt RandomStream s double lambda A static method for generating a random variate from a Poisson distribution with parameter A lambda 16 PoissonTIACGen This class implements random variate generators having the Poisson distri
30. elect the observations generator kGen to generate the added noise from the kernel density bandwidth h and o sigmak2 used for the variance correction public KernelDensityVarCorrectGen RandomStream s EmpiricalDist dist NormalGen kGen This constructor uses a gaussian kernel and the default bandwidth suggested in Table 1 for the gaussian distribution 42 LaplaceGen This class implements methods for generating random variates from the Laplace distribution Its density is see 19 page 165 1 Flia JJ for 00 lt xT lt OO 25 where gt 0 No local copy of the parameters 0 and is maintained in this class The non static nextDouble method simply calls inverseF on the distribution package umontreal iro lecuyer randvar public class LaplaceGen extends RandomVariateGen Constructors public LaplaceGen RandomStream s LaplaceDist dist Creates a new generator for the Laplace distribution dist and stream s Methods public static double nextDouble RandomStream s double theta double phi Generates a new variate from the Laplace distribution with parameters 6 theta and phi using stream s 43 LogisticGen This class implements random variate generators for the logistic distribution Its parameters are a and A gt 0 Its density function is Ne Mua Pi a Nena for 00 lt x lt O00 26 er T QU No local copy of the parameters a and A is maintained in this class The non static
31. generator object for distribution dist and stream s Methods public static double nextDouble RandomStream s double alpha double lambda Uses inversion to generate a new variate from the extreme value distribution with parameters a alpha and lambda using stream s 32 FatigueLifeGen This class implements random variate generators for the Fatigue Life distribution with lo cation parameter u scale parameter 3 and shape parameter y The density function of this distribution is EE dy 2 i E fa 4 am 16 2y x where is the probability density of the standard normal distribution package umontreal iro lecuyer randvar public class FatigueLifeGen extends RandomVariateGen Constructors public FatigueLifeGen RandomStream s FatigueLifeDist dist Creates a new generator for the distribution dist using stream s Methods public static double nextDouble RandomStream s double mu double beta double gamma Generates a variate from the Fatigue Life distribution with location parameter u scale parameter P and shape parameter y FisherFGen 33 This class implements random variate generators for the Fisher F distribution with n and m degrees of freedom where n and m are positive integers The density function of this distribution is Tas 2 gt for 0 17 package umontreal iro lecuyer randvar public class FisherFGen extends RandomVariateGen Constructors
32. ienna 24 This interface can be used to access distributions or generation methods not available directly in SSJ To get a UNURAN generator it suffices to instantiate one of the UNURAN interface classes UnuranDiscretelInt for discrete random variates UnuranContinuous for continuous ones in one dimension and UnuranEmpirical for quasi empirical distributions based on experimental data The type of distribution and its parameters are specified to UNURAN via its String API see the UNURAN documentation Only univariate distributions are supported because the UNURAN String API does not support the multivariate ones yet In the UNURAN interface classes nextDouble and nextInt can be invoked as usual to generate variates but these methods are slowed down significantly by the overhead in the interactions between code on the native side and on the Java side When several random variates are needed it is much more efficient to generate them in a single call via the methods nextArrayOfDouble and nextArrayOf Int RandomVariateGen This is the base class for all random variate generators over the real line It specifies the signature of the nextDouble method which is normally called to generate a real valued random variate whose distribution has been previously selected A random variate generator object can be created simply by invoking the constructor of this class with previously created RandomStream and Distribution objects or by invoking the const
33. l iro lecuyer randvar public class NormalBoxMullerGen extends NormalGen Constructors public NormalBoxMullerGen RandomStream s NormalDist dist Creates a random variate generator for the normal distribution dist and stream s 50 NormalPolarGen This class implements normal random variate generators using the polar method with rejec tion 25 Since the method generates two variates at a time the second variate is returned upon the next call to nextDouble A local copy of the parameters y and is maintained in this class package umontreal iro lecuyer randvar public class NormalPolarGen extends NormalGen Constructors public NormalPolarGen RandomStream s NormalDist dist Creates a random variate generator for the normal distribution dist and stream s 51 NormalKindermannRamageGen This class implements normal random variate generators using the Kindermann Ramage method 22 The code was taken from UNURAN 24 A local copy of the parameters u and o is maintained in this class package umontreal iro lecuyer randvar public class NormalKindermannRamageGen extends NormalGen Constructors public NormalKindermannRamageGen RandomStream s NormalDist dist Creates a random variate generator for the normal distribution dist and stream s 52 ParetoGen This class implements random variate generators for one of the Pareto distributions with parameters a gt 0 and 8 gt 0 Its density function
34. m s 56 StudentPolarGen This class implements Student random variate generators using the polar method of 4 The code is adapted from UNURAN see 24 The non static nextDouble method generates two variates at a time and the second one is saved for the next call A pair of variates is generated every second call In the static case two variates are generated per call but only the first one is returned and the second is discarded package umontreal iro lecuyer randvar public class StudentPolarGen extends StudentGen Constructors public StudentPolarGen RandomStream s StudentDist dist Creates a new generator for the Student distribution dist and stream s 57 TriangularGen This class implements random variate generators for the triangular distribution Its density is a fora lt a lt m f z git form lt 2 lt b 34 b a b m 0 elsewhere where a lt m lt b see e g 23 The non static nextDouble method simply calls inverseF on the distribution package umontreal iro lecuyer randvar public class TriangularGen extends RandomVariateGen Constructors public TriangularGen RandomStream s TriangularDist dist Creates a new generator for the triangular distribution dist and stream s Methods public static double nextDouble RandomStream s double a double b double m Generates a new variate from the triangular distribution with parameters a a b b and m m and strea
35. m s double p Generates a new geometric random variate with parameter p p using stream s by inver sion 11 HypergeometricGen This class implements random variate generators for the hypergeometric distribution Its mass function is see e g 14 page 101 Bis where m l and k are integers that satisfy 0 lt m lt land0 lt k lt l plx for x max 0 k l m min k m 3 The generation method is inversion using the chop down algorithm package umontreal iro lecuyer randvar public class HypergeometricGen extends RandomVariateGenInt Constructors public HypergeometricGen RandomStream s HypergeometricDist dist Creates a new generator for distribution dist using stream s Methods public static int nextInt RandomStream s int m int 1 int k Generates a new variate from the hypergeometric distribution with parameters m m l 1 and k k using stream s 12 LogarithmicGen This class implements random variate generators for the discrete logarithmic distribution Its mass function is _ ge Dey x log 1 0 where 0 lt 0 lt 1 It uses inversion with the LS chop down algorithm if 9 lt 69 and the LK transformation algorithm if 9 gt 69 as described in 21 The threshold 9 can be specified when invoking the constructor Its default value is 04 0 96 as suggested in 21 for xz 1 2 4 A local copy of the parameter is maintained in this class
36. m s using inversion 58 UniformGen This class implements random variate generators for the continuous uniform distribution over the interval a b where a and b are real numbers with a lt b The density is f x 1 b a for a lt x lt b 35 The non static nextDouble method simply calls inverseF on the distribution package umontreal iro lecuyer randvar public class UniformGen extends RandomVariateGen Constructors public UniformGen RandomStream s UniformDist dist Creates a new generator for the uniform distribution dist and stream s Methods static public double nextDouble RandomStream s double a double b Generates a new uniform random variate over the interval a b by inversion using stream S 59 WeibullGen This class implements random variate generators for the Weibull distribution Its density is f x a x 0 exp A z for x gt 36 and f x 0 elsewhere where a gt 0 and A gt 0 No local copy of the parameters and 6 is maintained in this class The non static nextDouble method simply calls inverseF on the distribution package umontreal iro lecuyer randvar public class WeibullGen extends RandomVariateGen Constructors public WeibullGen RandomStream s WeibullDist dist Creates a new generator for the Weibull distribution dist and stream s Methods public static double nextDouble RandomStream s double alpha double lambd
37. nsity function is e lte 1 20 29 210 No local copy of the parameters a and A is maintained in this class The non static nextDouble method simply calls inverseF on the distribution package umontreal iro lecuyer randvar public class NormalGen extends RandomVariateGen Constructors public NormalGen RandomStream s NormalDist dist Creates a random variate generator for the normal distribution dist and stream s Methods public static double nextDouble RandomStream s double mu double sigma Generates a variate from the normal distribution with parameters u mu and o sigma using stream s 48 NormalACRGen This class implements normal random variate generators using the acceptance complement ratio method 15 For all the methods the code was taken from UNURAN 24 A local copy of the parameters u and o is maintained in this class package umontreal iro lecuyer randvar public class NormalACRGen extends NormalGen Constructors public NormalACRGen RandomStream s NormalDist dist Creates a random variate generator for the normal distribution dist and stream s 49 NormalBoxMullerGen This class implements normal random variate generators using the Bor Muller method from 7 Since the method generates two variates at a time the second variate is returned upon the next call to the nextDouble A local copy of the parameters y and is maintained in this class package umontrea
38. ntain local copies of the distribution parameters and use them for variate generation If the parameters of the contained distribution objects are later modified this may lead to inconsistencies the variate generator object will keep using the old values In fact the constructors of the specialized classes often precompute constants and tables based on these parameter values which would have to be recomputed if the parameters are changed On the other hand the generic classes RandomVariateGen and RandomVariateGenInt call directly the inverseF method of the contained distribution object so they will always use the new parameter values whenever the parameters in the distribution object are changed 1 From Pierre It seems to me that in the future only the constructors of RandomVariateGen and RandomVariateGenInt should require a distribution object In the subclasses we should directly pass the required parameters and there would not necessarily be a distribution object created We should examine the implications of such a change CONTENTS 3 Static methods in the specialized classes allow the generation of random variates from specific distributions without constructing a RandomVariateGen object This package also provides an interface to the UNURAN Universal Non Uniform RAN dom number generators package a rich library of C functions designed and implemented by the ARVAG Automatic Random VAriate Generation project group in V
39. ratified rejection and squeeze method for generating beta random numbers Annals of the Institute of Mathematical Statistics 35B 291 302 1983 B Silverman Density Estimation for Statistics and Data Analysis Chapman and Hall London 1986 E Stadlober and H Zechner Generating beta variates via patchwork rejection Com puting 50 1 18 1993 G Ulrich Computer generation of distributions on the m sphere Applied Statistics 33 158 163 1984
40. rejection are obtained from the auxiliary stream package umontreal iro lecuyer randvar public class GammaRejectionLoglogisticGen extends GammaGen Constructors public GammaRejectionLoglogisticGen RandomStream s GammaDist dist Creates a new generator object for the gamma distribution dist and stream s for both the main and auxiliary stream public GammaRejectionLoglogisticGen RandomStream s RandomStream aux GammaDist dist Creates a new generator object for the gamma distribution dist using main stream s and auxiliary stream aux The auxiliary stream is used when a random number of uniforms is required for a rejection type generation method Methods public RandomStream getAuxStream Returns the auxiliary stream associated with this object public static double nextDouble RandomStream s RandomStream aux double alpha double lambda Generates a new gamma variate with parameters a alpha and lambda using main stream s and auxiliary stream aux public static double nextDouble RandomStream s double alpha double lambda Same as nextDouble s s alpha lambda 37 HyperbolicSecantGen This class implements random variate generators for the Hyperbolic Secant distribution with location parameter u and scale parameter o The density function of this distribution is HG cei 52 20 20 2 o package umontreal iro lecuyer randvar public class HyperbolicSecantGen extends RandomVariateGen Constr
41. ructor of a subclass By default all random variates will be generated via inversion by calling the inverseF method for the distribution even though this can be inefficient in some cases For some of the distributions there are subclasses with special and more efficient methods to generate the random variates For generating many random variates creating an object and calling the non static method is more efficient when the generating algorithm involves a significant setup When no work is done at setup time the static methods are usually slightly faster package umontreal iro lecuyer randvar public class RandomVariateGen Constructor public RandomVariateGen RandomStream s Distribution dist Creates a new random variate generator from the distribution dist using stream s Methods public double nextDouble Generates a random number from the continuous distribution contained in this object By default this method uses inversion by calling the inverseF method of the distribution object Alternative generating methods are provided in subclasses public void nextArrayOfDouble double v int start int n Generates n random numbers from the continuous distribution contained in this object These numbers are stored in the array v starting from index start By default this method calls nextDouble n times but one can override it in subclasses for better efficiency public RandomStream getStream Returns the RandomStre
42. t oe Bee Ree eee ee Ae ee OS ee ee GF 45 seb eee Ee eee eee ee ee a eee ee hed 46 ts E e a ee Bre so e 47 be A NN 48 cas cas a a a a amp 49 AA 50 NormalKindermannRamagebed o e 51 AI 52 LE bee cute a As A A 53 e a Ste ee a A A e A ee ee 54 nik Se ces Stee ee e na e e e lea de y al ee ee 55 ER e alee eel O a O i 56 aia o diia y dos io 57 A E ENE 58 E Gey oe O oe Ba eee a a 59 60 a a A A A Re AE OG eS BS 60 subs ODES SOE ES e a OE ZA BS 61 po e aaa aa a RB ae ld Be aS 62 UnuranException e sd 0 EE EA E 63 CONTENTS 2 Overview This package provides a collection of classes for non uniform random variate generation primarily from standard distributions Each non uniform random variate generator requires at least one RandomStream object from package rng used to generate the underlying uniform random numbers With some variate generation methods e g the rejection method the number of uniforms required to get a single non uniform variate varies from one call to the next In that case an aux iliary stream is often used to preserve the synchronization between random variates when implementing variance reduction methods 23 The main random number stream is called a fixed number of times per non uniform variate generation If more uniform random numbers are needed they are obtained from the auxiliary stream For these types of generators two RandomStream objects should be passed to the constructor Otherwis
43. ublic class ChiSquareGen extends RandomVariateGen Constructors public ChiSquareGen RandomStream s ChiSquareDist dist Create a new generator for the distribution dist and stream s Methods public static double nextDouble RandomStream s int n Generates a new variate from the chi square distribution with n degrees of freedom using stream s 28 ErlangGen This class implements random variate generators for the Erlang distribution with parameters k gt 0and A gt 0 This Erlang random variable is the sum of k exponentials with parameter A and has mean k A No local copy of the parameters k and A is maintained in this class The non static nextDouble method simply calls inverseF on the distribution package umontreal iro lecuyer randvar public class ErlangGen extends GammaGen Constructors public ErlangGen RandomStream s ErlangDist dist Creates a new generator for the distribution dist and stream s Methods public static double nextDouble RandomStream s int k double lambda Generates a new variate from the Erlang distribution with parameters k k and A lambda using stream s 29 ErlangConvolutionGen This class implements Erlang random variate generators using the convolution method This method uses inversion to generate k exponential variates with parameter A and returns their sum A local copy of the parameters k and A is maintained in this class package umontreal iro lecuyer randvar
44. uctors public HyperbolicSecantGen RandomStream s HyperbolicSecantDist dist Creates a new generator for the distribution dist using stream s Methods public static double nextDouble RandomStream s double mu double sigma Generates a variate from the Hyperbolic Secant distribution with location parameter u and scale parameter o 38 InverseGaussianGen This class implements random variate generators for the inverse Gaussian distribution with location parameter u gt 0 and scale parameter A gt 0 The density function of this distribu tion is A Ma f x zp P 2a for x gt 0 21 TL package umontreal iro lecuyer randvar public class InverseGaussianGen extends RandomVariateGen Constructors public InverseGaussianGen RandomStream s InverseGaussianDist dist Creates a new generator for the distribution dist using stream s Methods public static double nextDouble RandomStream s double mu double lambda Generates a variate from the inverse gaussian distribution with location parameter u gt 0 and scale parameter A gt 0 39 KernelDensityGen This class implements random variate generators for distributions obtained via kernel density estimation methods from a set of n individual observations 2 t 13 M1 16 17 27 The basic idea is to center a copy of the same symmetric density at each observation and take an equally weighted mixture of the n copies as an estimator of the density from
45. uired is taken from the main stream and all additional uniforms after the first rejection are obtained from the auxiliary stream package umontreal iro lecuyer randvar public class GammaAcceptanceRejectionGen extends GammaGen Constructors public GammaAcceptanceRejectionGen RandomStream s GammaDist dist Creates a new generator object for the gamma distribution dist and stream s for both the main and auxiliary stream public GammaAcceptanceRejectionGen RandomStream s RandomStream aux GammaDist dist Creates a new generator object for the gamma distribution dist using main stream s and auxiliary stream aux The auxiliary stream is used when a random number of uniforms is required for a rejection type generation method Methods public RandomStream getAuxStream Returns the auxiliary stream associated with this object public static double nextDouble RandomStream s RandomStream aux double alpha double lambda Generates a new gamma variate with parameters a alpha and lambda using main stream s and auxiliary stream aux public static double nextDouble RandomStream s double alpha double lambda Same as nextDouble s s alpha lambda 36 GammaRejectionLoglogisticGen This class implements gamma random variate generators using a rejection method with loglogistic envelopes from 9 For each gamma variate the first two uniforms are taken from the main stream and all additional uniforms after the first
46. y random number stream 62 UnuranEmpirical This class permits one to create generators for empirical and quasi empirical univariate distributions using UNURAN via its string interface The empirical data can be read from a file from an array or simply encoded into the generator specification string When reading from a file or an array the generator specification string must not contain a distribution specification string package umontreal iro lecuyer randvar public class UnuranEmpirical extends RandomVariateGen Constructors public UnuranEmpirical RandomStream s String genStr Constructs a new empirical univariate generator using the specification string genStr and stream s public UnuranEmpirical RandomStream s RandomStream aux String genStr Constructs a new empirical univariate generator using the specification string genStr with main stream s and auxiliary stream aux public UnuranEmpirical RandomStream s PiecewiseLinearEmpiricalDist dist String genStr Same as UnuranEmpirical s s dist genStr public UnuranEmpirical RandomStream s RandomStream aux PiecewiseLinearEmpiricalDist dist String genStr Same as UnuranEmpirical s aux genStr but reading the observations from the empir ical distribution dist The genStr argument must not contain a distribution part because the distribution will be generated from the input stream reader Methods public RandomStream getAuxStream Returns the auxiliary
Download Pdf Manuals
Related Search
Related Contents
Philips BlueVision ultra Automotive headlighting lamp 12342BVUB1 Zotac H61MAT-D-E motherboard MANUAL DE INSTRUCCIONES Smeg PALERMO faucet JB-200 - Tecnologie Creative König CSKBU100BE Samsung GT-E1110 Korisničko uputstvo dynabookガイド Newstar FPMA-W825 flat panel wall mount Accesorios Copyright © All rights reserved.
Failed to retrieve file