de.erichseifert.gral.data.statistics
Class Statistics

java.lang.Object
  extended by de.erichseifert.gral.data.statistics.Statistics
All Implemented Interfaces:
DataListener

public class Statistics
extends Object
implements DataListener

A class that computes and stores various statistical information on a data source.


Field Summary
static String KURTOSIS
          Key for specifying the kurtosis.
static String MAX
          Key for specifying the maximum, i.e. the largest value.
static String MEAN
          Key for specifying the arithmetic mean of all values.
static String MEAN_DEVIATION
          Key for specifying the expected value.
static String MEDIAN
          Key for specifying the median (or 50% quantile).
static String MIN
          Key for specifying the minimum, i.e. the smallest value.
static String N
          Key for specifying the total number of elements.
static String SKEWNESS
          Key for specifying the skewness.
static String SUM
          Key for specifying the sum of all values.
static String SUM2
          Key for specifying the sum of all value squares.
static String SUM3
          Key for specifying the sum of all value cubics.
static String SUM4
          Key for specifying the sum of all value quads.
static String VARIANCE
          Key for specifying the variance.
 
Constructor Summary
Statistics(DataSource data)
          Creates a new Statistics object with the specified DataSource.
 
Method Summary
 void dataChanged(DataSource data)
          Method that is invoked by objects that provide support for DataListeners.
 double get(String key)
          Returns the specified information for the data source.
 double get(String key, Orientation orientation, int index)
          Returns the specified information for the specified column or row.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUM

public static final String SUM
Key for specifying the sum of all values.

See Also:
Constant Field Values

SUM2

public static final String SUM2
Key for specifying the sum of all value squares.

See Also:
Constant Field Values

SUM3

public static final String SUM3
Key for specifying the sum of all value cubics.

See Also:
Constant Field Values

SUM4

public static final String SUM4
Key for specifying the sum of all value quads.

See Also:
Constant Field Values

MEAN

public static final String MEAN
Key for specifying the arithmetic mean of all values.

See Also:
Constant Field Values

MIN

public static final String MIN
Key for specifying the minimum, i.e. the smallest value.

See Also:
Constant Field Values

MAX

public static final String MAX
Key for specifying the maximum, i.e. the largest value.

See Also:
Constant Field Values

N

public static final String N
Key for specifying the total number of elements. This is the zeroth central moment: E((x - ยต)^0)

See Also:
Constant Field Values

MEAN_DEVIATION

public static final String MEAN_DEVIATION
Key for specifying the expected value. This is the first central moment: E((x - E(x))^1)

See Also:
Constant Field Values

VARIANCE

public static final String VARIANCE
Key for specifying the variance. This is the second central moment: E((x - E(x))^2)

See Also:
Constant Field Values

SKEWNESS

public static final String SKEWNESS
Key for specifying the skewness. This is the third central moment: E((x - E(x))^3)

See Also:
Constant Field Values

KURTOSIS

public static final String KURTOSIS
Key for specifying the kurtosis. This is the fourth central moment: E((x - E(x))^4)

See Also:
Constant Field Values

MEDIAN

public static final String MEDIAN
Key for specifying the median (or 50% quantile).

See Also:
Constant Field Values
Constructor Detail

Statistics

public Statistics(DataSource data)
Creates a new Statistics object with the specified DataSource.

Parameters:
data - DataSource to be analyzed.
Method Detail

get

public double get(String key,
                  Orientation orientation,
                  int index)
Returns the specified information for the specified column or row.

Parameters:
key - Requested information.
orientation - Direction of the values the statistical is built from.
index - Column or row index.
Returns:
Calculated value.

get

public double get(String key)
Returns the specified information for the data source.

Parameters:
key - Requested information.
Returns:
Calculated value.

dataChanged

public void dataChanged(DataSource data)
Description copied from interface: DataListener
Method that is invoked by objects that provide support for DataListeners.

Specified by:
dataChanged in interface DataListener
Parameters:
data - data that has changed


Copyright © 2009-2010. All Rights Reserved.