Function Trimmed-Mean

Part of:

package cl-mathstats
( trimmed-mean &rest < args > )
TRIMMED-MEAN (DATA PERCENTAGE &KEY START END KEY)
Returns a trimmed mean of `data.' A trimmed mean is an ordinary, arithmetic mean of the data, except that an outlying percentage has been discarded. For example, suppose there are ten elements in `data,' and `percentage' is 0.1: the result would be the mean of the middle eight elements, having discarded the biggest and smallest elements. If `percentage' doesn't result in a whole number of elements being discarded, then a fraction of the remaining biggest and smallest is discarded. For example, suppose `data' is '(1 2 3 4 5) and `percentage' is 0.25: the result is (.75(2) + 3 + .75(4))/(.75+1+.75) or 3. By convention, the 0.5 trimmed mean is the median, which is always returned as a number.