Class Statistics


  • public class Statistics
    extends java.lang.Object
    Class for collecting data and calculating simple statistics.
    • Constructor Summary

      Constructors 
      Constructor Description
      Statistics()  
      Statistics​(long cPtr, boolean cMemoryOwn)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(double t)
      Add data to statistics
      double angularMean()
      Returns the angular mean of the values added

      The angular mean is computed as \tan^{-1}\frac{\Sigma_{d\in data}\sin(d)}{\Sigma_{d\in data}\cos(d)}
      pair_d_d angularMeanAndVariance()
      returns the angular mean and the variance of the data.

      See documentation of Statistics::angularMean() and Statistics::angularVariance()
      for how the mean and variane are computed.
      double angularVariance()
      Returns the angular variance of the values added
      The variance is computed as \frac{1}{n-1} \Sigma_{d\in data}\left[\cos^{-1}(\sin(d)\sin(\mu)-\cos(d)\cos(\mu))\right]^2 where \mu is
      the angular mean of the data.
      void clear()
      Clear the recorded statistics data
      SWIGTYPE_p_std__listT_double_t data()
      Provides reference to the internal data container
      void delete()  
      static long getCPtr​(Statistics obj)  
      double maxValue()
      Returns the maximum value of data added.

      If no data is added 0 is returned.
      double mean()
      Returns the mean of the values added

      The mean is computed as \frac{1}{n} \Sigma_{d\in data}d
      pair_d_d meanAndVariance()
      returns the mean and the variance of the data.

      See documentation of Statistics::mean() and Statistics::variance()
      for how the mean and variane are computed.
      double median()
      Returns the median of the values added

      Given an equal number of element, the mean is calculated as the average of the two center
      elements.
      pair_d_d minAndMaxValue()
      Returns pair containing the minimum and maximum value of the data added.

      If no data is added 0 is returned for both values.
      double minValue()
      Returns the minimum value of data added.

      If no data is added 0 is returned.
      java.lang.String toString()  
      double variance()
      Returns the variance of the values added
      The variance is computed as \frac{1}{n-1} \Sigma_{d\in data}(m-\mu)^2
      where \mu is the mean of the data.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Statistics

        public Statistics​(long cPtr,
                          boolean cMemoryOwn)
      • Statistics

        public Statistics()
    • Method Detail

      • getCPtr

        public static long getCPtr​(Statistics obj)
      • delete

        public void delete()
      • mean

        public double mean()
        Returns the mean of the values added

        The mean is computed as \frac{1}{n} \Sigma_{d\in data}d
      • angularMean

        public double angularMean()
        Returns the angular mean of the values added

        The angular mean is computed as \tan^{-1}\frac{\Sigma_{d\in data}\sin(d)}{\Sigma_{d\in data}\cos(d)}
      • median

        public double median()
        Returns the median of the values added

        Given an equal number of element, the mean is calculated as the average of the two center
        elements.
      • variance

        public double variance()
        Returns the variance of the values added
        The variance is computed as \frac{1}{n-1} \Sigma_{d\in data}(m-\mu)^2
        where \mu is the mean of the data.
      • angularVariance

        public double angularVariance()
        Returns the angular variance of the values added
        The variance is computed as \frac{1}{n-1} \Sigma_{d\in data}\left[\cos^{-1}(\sin(d)\sin(\mu)-\cos(d)\cos(\mu))\right]^2 where \mu is
        the angular mean of the data.
      • meanAndVariance

        public pair_d_d meanAndVariance()
        returns the mean and the variance of the data.

        See documentation of Statistics::mean() and Statistics::variance()
        for how the mean and variane are computed.
      • angularMeanAndVariance

        public pair_d_d angularMeanAndVariance()
        returns the angular mean and the variance of the data.

        See documentation of Statistics::angularMean() and Statistics::angularVariance()
        for how the mean and variane are computed.
      • minValue

        public double minValue()
        Returns the minimum value of data added.

        If no data is added 0 is returned.
      • maxValue

        public double maxValue()
        Returns the maximum value of data added.

        If no data is added 0 is returned.
      • minAndMaxValue

        public pair_d_d minAndMaxValue()
        Returns pair containing the minimum and maximum value of the data added.

        If no data is added 0 is returned for both values.
      • add

        public void add​(double t)
        Add data to statistics
      • clear

        public void clear()
        Clear the recorded statistics data
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object