Class MedianCalculator

  • All Implemented Interfaces:
    Function<double[],​Double>

    public class MedianCalculator
    extends Object
    implements Function<double[],​Double>
    Calculates the median of a series of data.

    If the data are sorted from lowest to highest $(x_1, x_2, \dots, x_n)$, the median is given by $$ \begin{align*} m = \begin{cases} x_{\frac{n+1}{2}}\quad & n \text{ odd}\\ \frac{1}{2}\left(x_{\frac{n}{2}} + x_{\frac{n}{2} + 1}\right)\quad & n \text{ even} \end{cases} \end{align*} $$

    • Constructor Detail

      • MedianCalculator

        public MedianCalculator()