gov.nist.microanalysis.Utility
Class DescriptiveStatistics

java.lang.Object
  extended by gov.nist.microanalysis.Utility.DescriptiveStatistics

public class DescriptiveStatistics
extends java.lang.Object

A simple class to calculate four basic descriptive statistics - average, variance, skewness and kurtosis. Create an instance of the class, then use addPoint() to record data points. At any time you may call one of the statistic functions to return the current value of the statistic.

Copyright: Pursuant to title 17 Section 105 of the United States Code this software is not subject to copyright protection and is in the public domain

Company: National Institute of Standards and Technology

Version:
1.0
Author:
Nicholas W. M. Ritchie

Constructor Summary
DescriptiveStatistics()
          Constructs an empty DescriptiveStatistics object
DescriptiveStatistics(DescriptiveStatistics ds1, DescriptiveStatistics ds2)
          Form a DescriptiveStatistics object which combines the statistics from two source DescriptiveStatistics objects into one.
 
Method Summary
 void add(double x)
          Add a number to the accumulated statistics.
 double average()
          The average value of the values added to this object using the add method.
 double kurtosis()
          kurtosis - (E[(x-mu)^4]/sigma^4) - 3
 double maximum()
          maximum - The maximum value in the list
 double minimum()
          minimum - The minimum value in the list
 double skewness()
          skewness - E[(x-mu)^3]/sigma^3
 double standardDeviation()
          standardDeviation - The square root of the variance.
 double standardErrorOfKurtosis()
          standardErrorOfKurtosis - A number against which the kurtosis can be compared to determine whether the distribution has a significant kurtosis.
 double standardErrorOfSkewness()
          standardErrorOfSkewness - A number against which to compare the skewness to determine the statistical significance.
 java.lang.String toString()
           
 double variance()
          variance - sigma^2=E[(x-mu)^2]
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DescriptiveStatistics

public DescriptiveStatistics(DescriptiveStatistics ds1,
                             DescriptiveStatistics ds2)
Form a DescriptiveStatistics object which combines the statistics from two source DescriptiveStatistics objects into one. For example, the average of the resulting object is the average of the source objects weighted by the number of items in each.

Parameters:
ds1 -
ds2 -

DescriptiveStatistics

public DescriptiveStatistics()
Constructs an empty DescriptiveStatistics object

Method Detail

add

public void add(double x)
Add a number to the accumulated statistics.

Parameters:
x -

average

public double average()
The average value of the values added to this object using the add method.

Returns:
double

variance

public double variance()
variance - sigma^2=E[(x-mu)^2]

Returns:
double

standardDeviation

public double standardDeviation()
standardDeviation - The square root of the variance.

Returns:
double

skewness

public double skewness()
skewness - E[(x-mu)^3]/sigma^3

Returns:
double

standardErrorOfSkewness

public double standardErrorOfSkewness()
standardErrorOfSkewness - A number against which to compare the skewness to determine the statistical significance. A skewness of in excess of twice this number indicates a distribution that is highly likely to be skewed.

Returns:
double

kurtosis

public double kurtosis()
kurtosis - (E[(x-mu)^4]/sigma^4) - 3

Returns:
double

standardErrorOfKurtosis

public double standardErrorOfKurtosis()
standardErrorOfKurtosis - A number against which the kurtosis can be compared to determine whether the distribution has a significant kurtosis. A kurtosis of twice this number indicates a statistically significant kurtosis.

Returns:
double

minimum

public double minimum()
minimum - The minimum value in the list

Returns:
double

maximum

public double maximum()
maximum - The maximum value in the list

Returns:
double

toString

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