Page 68 - Computational Statistics Handbook with MATLAB
P. 68

54                         Computational Statistics Handbook with MATLAB


                                                               n
                                                             1
                                                         X =  --- ∑  X  i  .                (3.1)
                                                             n
                                                               i =  1
                             To calculate this in MATLAB, one can use the function called mean. If the
                             argument to this function is a matrix, then it provides a vector of means, each
                             one corresponding to the mean of a column. One can find the mean along any
                             dimension (dim) of multi-dimensional arrays using the syntax:
                             mean(x,dim).
                              Another statistic that we will see again is the sample variance, calculated
                             from


                                                 n                    n       n   
                                                                                    2
                                             1
                                                                1
                                                         2
                                                                           2
                                        2
                                                                    
                                      S =  ------------ ∑ ( X i –  X) =  -------------------- n ∑  X i –  ∑  X i  .   (3.2)
                                                              (
                                           n –  1            nn –  1)             
                                                i =  1                i =  1  i =  1
                             The sample standard deviation is given by the square root of the variance
                             (Equation 3.2) and is denoted by  . These statistics can be calculated in
                                                            S
                             MATLAB using the functions std(x)and var(x), where x is an array con-
                             taining the sample values. As with the function mean, these can have matri-
                             ces or multi-dimensional arrays as input arguments.
                             Sample
                                    oments
                             SampleM  M oments
                             SSampleample
                                    MM omentsoments
                             The sample moments can be used to estimate the population moments
                             described in Chapter 2. The r-th sample moment about zero is given by
                                                                n
                                                              1    r
                                                        M' r =  --- ∑  X i  .               (3.3)
                                                              n
                                                               i =  1
                             Note that the sample mean is obtained when  r =  1  . The  r-th sample
                             moments about the sample mean are statistics that estimate the population
                             central moments and can be found using the following

                                                             n
                                                           1          r
                                                     M r =  --- ∑ ( X i –  X)  .            (3.4)
                                                           n
                                                            i =  1
                              We can use Equation 3.4 to obtain estimates for the coefficient of skewness
                                                            . Recall that these are given by
                             γ 1   and the coefficient of kurtosis γ 2





                            © 2002 by Chapman & Hall/CRC
   63   64   65   66   67   68   69   70   71   72   73