org.apache.commons.math.stat.univariate
Interface StorelessUnivariateStatistic

All Superinterfaces:
UnivariateStatistic
All Known Implementing Classes:
AbstractStorelessUnivariateStatistic

public interface StorelessUnivariateStatistic
extends UnivariateStatistic

Extends the capabilities of UnivariateStatistic with a statefull incremental strategy through three methods for calculating a statistic without having to maintain a double[] of the values. Because a StorelessUnivariateStatistic does not require that a double[] storage structure be maintained with the values in it, there are only a subset of known statistics can actually be implemented using it. If a Statistic cannot be implemented in a Storeless approach it should implement the UnivariateStatistic interface directly instead.

Version:
$Revision: 1.12 $ $Date: 2003/11/19 03:28:25 $

Method Summary
 void clear()
          Clears all the internal state of the Statistic
 double getN()
          Returns the current state of the statistic after the last increment.
 double getResult()
          Returns the current state of the statistic after the last increment.
 void increment(double d)
          Increments the internal state of the Storagless Implementation.
 
Methods inherited from interface org.apache.commons.math.stat.univariate.UnivariateStatistic
evaluate, evaluate
 

Method Detail

increment

public void increment(double d)
Increments the internal state of the Storagless Implementation.

Parameters:
d - is the value to increment the state by.

getResult

public double getResult()
Returns the current state of the statistic after the last increment.

Returns:
value of the statistic, Double.NaN if it has been cleared or just instantiated.

getN

public double getN()
Returns the current state of the statistic after the last increment.

Returns:
value of the statistic, Double.NaN if it has been cleared or just instantiated.

clear

public void clear()
Clears all the internal state of the Statistic



Copyright © 2003-2004 Apache Software Foundation. All Rights Reserved.