public class Mean extends Object implements Statistic
E(X) = Σ (xi) / NThis implementation supports incremental update of the statistic. The R equivalent function is
mean.| Constructor and Description |
|---|
Mean()
Construct an empty
Mean calculator. |
Mean(double[] data)
Construct a
Mean calculator,
initialized with a sample. |
Mean(Mean that)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addData(double... data)
Recompute the statistic with more data, incrementally if possible.
|
long |
N()
Get the size of the sample.
|
String |
toString() |
double |
value()
Get the value of the statistic.
|
public Mean()
Mean calculator.public Mean(double[] data)
Mean calculator,
initialized with a sample.data - a samplepublic Mean(Mean that)
that - a Mean calculatorpublic void addData(double... data)
Statisticpublic double value()
Statisticpublic long N()
StatisticCopyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.