Class StatisticalSummary

java.lang.Object
ch.idsia.utils.statistics.StatisticalSummary
All Implemented Interfaces:
java.io.Serializable

public class StatisticalSummary
extends java.lang.Object
implements java.io.Serializable
This class is used to model the statistics of a fix of numbers. For the statistics we choose here it is not necessary to store all the numbers - just keeping a running total of how many, the sum and the sum of the squares is sufficient (plus max and min, for max and min).

Warning: the geometric mean calculation is only valid if all numbers added to the summary are positive (>0) - no warnings are given if this is not the case - you'll just get a wrong answer for the gm() !!!

See Also:
Serialized Form
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  StatisticalSummary.Watch  
  • Field Summary

    Fields 
    Modifier and Type Field Description
    java.lang.String name  
    StatisticalSummary.Watch watch  
  • Constructor Summary

    Constructors 
    Constructor Description
    StatisticalSummary()  
    StatisticalSummary​(java.lang.String name)  
  • Method Summary

    Modifier and Type Method Description
    void add​(double d)  
    void add​(double[] d)  
    void add​(StatisticalSummary ss)  
    void add​(java.lang.Number n)  
    void add​(java.util.Vector<java.lang.Number> v)  
    double gm()  
    static StatisticalSummary load​(java.lang.String path)  
    static void main​(java.lang.String[] args)  
    double max()  
    double mean()  
    double min()  
    int n()  
    void reset()  
    void save​(java.lang.String path)  
    double sd()  
    static double sigDiff​(StatisticalSummary s1, StatisticalSummary s2)  
    double stdErr()  
    double sumSquareDiff()
    returns the sum of the squares of the differences between the mean and the ith values
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • reset

      public final void reset()
    • max

      public double max()
    • min

      public double min()
    • mean

      public double mean()
    • gm

      public double gm()
    • sigDiff

      public static double sigDiff​(StatisticalSummary s1, StatisticalSummary s2)
    • sumSquareDiff

      public double sumSquareDiff()
      returns the sum of the squares of the differences between the mean and the ith values
    • sd

      public double sd()
    • n

      public int n()
    • stdErr

      public double stdErr()
    • add

      public void add​(StatisticalSummary ss)
    • add

      public void add​(double d)
    • add

      public void add​(java.lang.Number n)
    • add

      public void add​(double[] d)
    • add

      public void add​(java.util.Vector<java.lang.Number> v)
    • toString

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

      public void save​(java.lang.String path)
    • load

      public static StatisticalSummary load​(java.lang.String path)
    • main

      public static void main​(java.lang.String[] args) throws java.lang.Exception
      Throws:
      java.lang.Exception