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:
“Sight is the least sensual of all the senses. And we strain ourselves to see, see, seeeverything, everything through the eye, in one mode of objective curiosity.”
—D.H. (David Herbert)
“If Thought is capable of being classed with Electricity, or Will with chemical affinity, as a mode of motion, it seems necessary to fall at once under the second law of thermodynamics as one of the energies which most easily degrades itself, and, if not carefully guarded, returns bodily to the cheaper form called Heat. Of all possible theories, this is likely to prove the most fatal to Professors of History.”
—Henry Brooks Adams (18381918)
“The present war having so long cut off all communication with Great-Britain, we are not able to make a fair estimate of the state of science in that country. The spirit in which she wages war is the only sample before our eyes, and that does not seem the legitimate offspring either of science or of civilization.”
—Thomas Jefferson (17431826)