trimmean

  • double trimmean(double* first, double* last, double f);
  • double trimmean(double* first, double* last, double f1, double f2);

  • Returns the mean of the elements in [first, last) with f*100 percent of the lowest and highest terms removed.
  • Returns the mean of the elements in [first, last) with f1*100 percent of the lowest terms and f2*100 percent of the highest terms removed.

    Parameters:
    firstBeginning iterator for the container of elements.
    lastEnding iterator for the container of elements.
    fFactor of elements to trim from the lowest and highest values.
    f1Factor of the lowest elements to trim.
    f2Factor of the highest elements to trim.

    Returns:
    Trimmed mean

    Usage:
    int s[4] = {1, 2, 3, 4};
    double t1 = trimmean(s, s + 4, .05);
    double t2 = trimmean(s, s + 4, .05, .025);

    Header:
    #include "descript.h"