Page 50 - Computational Statistics Handbook with MATLAB
P. 50

36                         Computational Statistics Handbook with MATLAB


                             In the Computational Statistics Toolbox, we include a function called csex-
                                    λ
                             poc(x, ) that calculates the exponential cumulative distribution function
                             using Equation 2.34.




                             Gammm mmaa
                             GGaamm ma  a
                             Ga
                             The gamma probability density function with parameters λ >  0  and t >  0  is
                                               (
                                                   ,
                                                        -------------------------------;
                                               f x λ t) =  λe – λx ( λx)  t –  1  x ≥  0,  (2.36)
                                                 ;
                                                            Γ t()
                             where t is a shape parameter, and λ is the scale parameter. The gamma func-
                             tion Γ t()  is  defined  as
                                                             ∞
                                                             ∫  e y  t –  1 d  . y         (2.37)
                                                                y
                                                               –
                                                      Γ t() =
                                                             0
                             For integer values of t, Equation 2.37 becomes


                                                        Γ t() =  ( t –  1)!  .             (2.38)

                              Note that for t = 1, the gamma density is the same as the exponential. When
                             t is a positive integer, the gamma distribution can be used to model the
                             amount of time one has to wait until t events have occurred, if the inter-
                             arrival times are exponentially distributed.
                              The mean and variance of a gamma random variable are

                                                                 t
                                                          EX[] =  ---  ,
                                                                 λ

                             and

                                                                 t
                                                         VX() =  -----  .
                                                                 λ 2

                             The cumulative distribution function for a gamma random variable is calcu-
                             lated using [Meeker and Escobar, 1998; Banks, et al., 2001]










                             © 2002 by Chapman & Hall/CRC
   45   46   47   48   49   50   51   52   53   54   55