Page 108 - Computational Statistics Handbook with MATLAB
P. 108

Chapter 4: Generating Random Variables                           95


                              The chi-square distribution is useful in situations where we need to system-
                             atically investigate the behavior of a statistic by changing the skewness of the
                             distribution. As the degrees of freedom for a chi-square increases, the distri-
                             bution changes from being right skewed to one approaching normality and
                             symmetry.



                             Bet
                               aa
                             BBeett taa
                             Be
                             The beta distribution is useful in simulations because it covers a wide range
                                                                                       α
                             of distribution shapes, depending on the values of the parameters   and β.
                             These shapes include skewed, uniform, approximately normal, and a bimo-
                             dal distribution with an interior dip.
                              First, we describe a simple approach for generating beta random variables
                                                  β
                                            α
                             with parameters   and  , when both are integers [Rubinstein, 1981; Gentle,
                                                                k
                             1998]. It is known [David, 1981] that the  -th order statistic of n uniform (0,1)
                             variates is distributed according to a beta distribution with parameters   and
                                                                                           k
                                k
                             n – +  1  . This means that we can generate random variables from the beta
                             distribution using the following procedure.
                             PROCEDURE - BETA RANDOM VARIABLES (INTEGER PARAMETERS)
                                                                               ,
                                                                                  ,
                                1. Generate  α +  β –  1   uniform random numbers:  U 1 … U α +  β –  1
                                2. Deliver  X =  U α()  which is the  α  -th order statistic.

                              One simple way to generate random variates from the beta distribution is
                                                                                     are indepen-
                             to use the following result from Rubinstein [1981]. If Y 1   and Y 2
                                                           has a gamma distribution with parameters
                             dent random variables, where Y 1
                                                                                    β
                             α   and 1, and Y 2   follows a gamma distribution with parameters   and 1, then
                                                               Y 1
                                                         X =  ------------------           (4.17)
                                                             Y +  Y 2
                                                               1
                                                                   α
                                                                         β
                             is from a beta distribution with parameters   and  . This is the method that
                             is used in the MATLAB Statistics Toolbox function betarnd that generates
                             random variates from the beta distribution. We illustrate the use of betarnd
                             in the following example.

                             Example 4.9
                             We use this example to illustrate the use of the MATLAB Statistics Toolbox
                             function that generates beta random variables. In general, most of these tool-
                             box functions for generating random variables use the following general syn-
                             tax:
                                rvs = pdfrnd(par1,par2,nrow,ncol);

                            © 2002 by Chapman & Hall/CRC
   103   104   105   106   107   108   109   110   111   112   113