Page 46 - MATLAB Recipes for Earth Sciences
P. 46

3.3 Example of Empirical Distributions                           37

           values contained in the data vector are
               max(corg)

             ans =
                14.5615
               min(corg)

             ans =
                 9.4168
           The range of the data values, i.e., the difference between maximum and
           minimum values is

             range(corg)
             ans =
                 5.1447

           The range of the data is the information that we need in order to defi ne the
           classes. Since we have decided to use eight classes, we split the range of the
           data into eight equal-sized bins. The approximate width of the intervals is

             5.1447/8

             ans =
                 0.6431
           We round this number up and defi ne

             v = 10 : 0.65 : 14.55;
           as midpoints of the histogram intervals. The commands for displaying the
           histogram and calculating the frequency distribution are

             hist(corg,v);
             n = hist(corg,v);

           The most important parameters describing the distribution are the averages
           and the dispersion about the average. The most popular measure for average
           is the arithmetic mean of our data.

             mean(corg)
             ans =
                 12.3448
           Since this measure is very susceptible to outliers, we use the median as an
   41   42   43   44   45   46   47   48   49   50   51