Class GeometricMeanCalculator

  • All Implemented Interfaces:

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

    The geometric mean $\mu$ of a series of elements $x_1, x_2, \dots, x_n$ is given by: $$ \begin{align*} \mu = \left({\prod\limits_{i=1}^n x_i}\right)^{\frac{1}{n}} \end{align*} $$

    • Constructor Detail

      • GeometricMeanCalculator

        public GeometricMeanCalculator()
    • Method Detail

      • apply

        public Double apply​(double[] x)
        Specified by:
        apply in interface Function<double[],​Double>
        x - The array of data, not null or empty
        The geometric mean