public class Mean<N extends Number> extends MappedAccumulator<N>
Calculate the Arithmetic mean from a finite sample of N observations.
Note that this implementation is not synchronized. If multiple threads access this object concurrently, and at least one of the threads modifies it, it must be synchronized externally.
Modifier and Type | Field and Description |
---|---|
protected double |
_mean |
_samples
Constructor and Description |
---|
Mean() |
Modifier and Type | Method and Description |
---|---|
void |
accumulate(N value)
Accumulate the given value.
|
Mean<N> |
clone() |
boolean |
equals(Object obj) |
double |
getMean()
Return the mean value of the accumulated values.
|
double |
getStandardError()
Return the
Standard error
of the calculated mean.
|
int |
hashCode() |
String |
toString() |
getSamples, map
protected double _mean
public Mean()
public double getMean()
Double.NaN
if getSamples() == 0
.public double getStandardError()
public void accumulate(N value)
Accumulator
accumulate
in interface Accumulator<N extends Number>
accumulate
in class MappedAccumulator<N extends Number>
value
- the value to accumulate.NullPointerException
- if the given value
is null
.public int hashCode()
hashCode
in class MappedAccumulator<N extends Number>
public boolean equals(Object obj)
equals
in class MappedAccumulator<N extends Number>
© 2007-2014 Franz Wilhelmstötter (2014-10-03 19:44)