|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.numericalmethod.suanshu.stats.descriptive.moment.Mean
public class Mean
The mean of a sample is the sum of all numbers in the sample, divided by the sample size.
E(X) = Σ (xi) / N
This implementation supports incremental update of the statistic.
The R equivalent function is mean.
| Constructor Summary | |
|---|---|
Mean()
Construct an empty Mean calculator. |
|
Mean(double[] data)
Construct a Mean calculator, initialized with a sample. |
|
Mean(Mean that)
Copy constructor. |
|
| Method Summary | |
|---|---|
void |
addData(double... data)
Recompute the statistic, incrementally if possible. |
long |
N()
Get the size of the sample. |
java.lang.String |
toString()
|
double |
value()
Get the value of the statistic. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Mean()
public Mean(double[] data)
data - a samplepublic Mean(Mean that)
that - another Mean object| Method Detail |
|---|
public void addData(double... data)
Statistic
addData in interface Statisticdata - an array of new itemspublic double value()
Statistic
value in interface Statisticpublic long N()
Statistic
N in interface Statisticpublic java.lang.String toString()
toString in class java.lang.Object
|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||