Package pamMaths

Class Mean

java.lang.Object
pamMaths.Mean

public class Mean extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    getMean(double[] data)
    Calculate the mean of all data in an array
    static double
    getMean(double[] data, int n)
    Calculate the mean of n elements in the array

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Mean

      public Mean()
  • Method Details

    • getMean

      public static double getMean(double[] data)
      Calculate the mean of all data in an array
      Parameters:
      data -
      Returns:
      mean of data
    • getMean

      public static double getMean(double[] data, int n)
      Calculate the mean of n elements in the array
      Parameters:
      data -
      n -
      Returns:
      mean of first n points