Mode (statistics) - Mode of A Sample

Mode of A Sample

The mode of a sample is the element that occurs most often in the collection. For example, the mode of the sample is 6. Given the list of data the mode is not unique - the dataset may be said to be bimodal, while a set with more than two modes may be described as multimodal.

For a sample from a continuous distribution, such as, the concept is unusable in its raw form, since no two values will be exactly the same, so each value will occur precisely once. In order to estimate the mode, the usual practice is to discretize the data by assigning frequency values to intervals of equal distance, as for making a histogram, effectively replacing the values by the midpoints of the intervals they are assigned to. The mode is then the value where the histogram reaches its peak. For small or middle-sized samples the outcome of this procedure is sensitive to the choice of interval width if chosen too narrow or too wide; typically one should have a sizable fraction of the data concentrated in a relatively small number of intervals (5 to 10), while the fraction of the data falling outside these intervals is also sizable. An alternate approach is kernel density estimation, which essentially blurs point samples to produce a continuous estimate of the probability density function which can provide an estimate of the mode.

The following MATLAB (or Octave) code example computes the mode of a sample:

X = sort(x); indices = find(diff > 0); % indices where repeated values change = max (diff); % longest persistence length of repeated values mode = X(indices(i));

The algorithm requires as a first step to sort the sample in ascending order. It then computes the discrete derivative of the sorted list, and finds the indices where this derivative is positive. Next it computes the discrete derivative of this set of indices, locating the maximum of this derivative of indices, and finally evaluates the sorted sample at the point where that maximum occurs, which corresponds to the last member of the stretch of repeated values.

Read more about this topic:  Mode (statistics)

Famous quotes containing the words mode of, mode and/or sample:

    A man of genius has a right to any mode of expression.
    Ezra Pound (1885–1972)

    Yours of the 24th, asking “the best mode of obtaining a thorough knowledge of the law” is received. The mode is very simple, though laborious, and tedious. It is only to get the books, and read, and study them carefully.... Work, work, work, is the main thing.
    Abraham Lincoln (1809–1865)

    All that a city will ever allow you is an angle on it—an oblique, indirect sample of what it contains, or what passes through it; a point of view.
    Peter Conrad (b. 1948)