|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math.stat.univariate.AbstractUnivariateStatistic
org.apache.commons.math.stat.univariate.AbstractStorelessUnivariateStatistic
org.apache.commons.math.stat.univariate.moment.Variance
Field Summary | |
protected boolean |
incMoment
Boolean test to determine if this Variance should also increment the second moment, this evaluates to false when this Variance is constructed with an external SecondMoment as a parameter. |
protected Mean |
mean
Mean to be used in UnvariateStatistic evaluation approach. |
protected SecondMoment |
moment
SecondMoment is used in incremental calculation of Variance |
protected int |
n
Maintains the current count of inrementations that have occured. |
protected double |
variance
This property maintains the latest calculated variance for efficiency when getResult() is called many times between increments. |
Constructor Summary | |
Variance()
Constructs a Variance. |
|
Variance(SecondMoment m2)
Constructs a Variance based on an externalized second moment. |
Method Summary | |
void |
clear()
Clears all the internal state of the Statistic |
double |
evaluate(double[] values,
int begin,
int length)
Returns the variance of the available values. |
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 class org.apache.commons.math.stat.univariate.AbstractUnivariateStatistic |
evaluate, test |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.commons.math.stat.univariate.UnivariateStatistic |
evaluate |
Field Detail |
protected SecondMoment moment
protected boolean incMoment
protected double variance
protected int n
protected Mean mean
Constructor Detail |
public Variance()
public Variance(SecondMoment m2)
m2
- the SecondMoment (Thrid or Fourth moments work
here as well.)Method Detail |
public void increment(double d)
StorelessUnivariateStatistic
increment
in interface StorelessUnivariateStatistic
increment
in class AbstractStorelessUnivariateStatistic
StorelessUnivariateStatistic.increment(double)
public double getResult()
StorelessUnivariateStatistic
getResult
in interface StorelessUnivariateStatistic
getResult
in class AbstractStorelessUnivariateStatistic
StorelessUnivariateStatistic.getResult()
public double getN()
StorelessUnivariateStatistic
getN
in interface StorelessUnivariateStatistic
StorelessUnivariateStatistic.getN()
public void clear()
StorelessUnivariateStatistic
clear
in interface StorelessUnivariateStatistic
clear
in class AbstractStorelessUnivariateStatistic
StorelessUnivariateStatistic.clear()
public double evaluate(double[] values, int begin, int length)
"Algorithms for Computing the Sample Variance: Analysis and Recommendations", Chan, T.F., Golub, G.H., and LeVeque, R.J. 1983, American Statistician, vol. 37, pp. 242?247.
evaluate
in interface UnivariateStatistic
evaluate
in class AbstractStorelessUnivariateStatistic
values
- Is a double[] containing the valuesbegin
- processing at this point in the arraylength
- processing at this point in the array
UnivariateStatistic.evaluate(double[], int, int)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |