public class OnlineStats
extends java.lang.Object
Constructor and Description |
---|
OnlineStats() |
Modifier and Type | Method and Description |
---|---|
double |
getCurrentMean()
Current mean value
|
int |
getN()
The number of elements seen so far.
|
double |
getSumSquaredMeanDiff()
The current sum of squares of differences from the current mean.
|
static void |
main(java.lang.String[] args) |
double |
mean()
Returns the current mean of the numbers.
|
double |
mean(Dataset input)
Updates the approximations then returns the current mean
|
double |
mean(double[] data)
Updates the statistics then returns the current mean
|
void |
setCurrentMean(double currentMean) |
void |
setN(int n) |
void |
setSumSquaredMeanDiff(double sumSquaredMeanDiff) |
double |
stddev()
Returns the current approximation of the standard deviation of the data.
|
double |
stddev(Dataset input)
Updates the statistics with the supplied values then returns the current standard deviation.
|
double |
stddev(double[] data)
Updates the statistics then returns the current standard deviation.
|
void |
update(Dataset input)
Updates the current mean, variance, and standard deviation approximations.
|
void |
update(double[] data)
Updates the current mean, variance, and standard deviation.
|
double |
variance()
Returns the current approximation of the variance of the data.
|
double |
variance(Dataset input)
Updates the statistics with new values then returns the current variance.
|
double |
variance(double[] data)
Updates the statistics then returns the current variance.
|
public void update(double[] data)
data
- new elementspublic void update(Dataset input)
input
- new elementspublic double mean()
public double mean(double[] data)
data
- new elementspublic double mean(Dataset input)
input
- new elementspublic double variance()
public double variance(double[] data)
data
- new elementspublic double variance(Dataset input)
input
- new elementspublic double stddev()
public double stddev(double[] data)
data
- new elementspublic double stddev(Dataset input)
input
- new elementspublic int getN()
public double getSumSquaredMeanDiff()
public void setN(int n)
public double getCurrentMean()
public void setCurrentMean(double currentMean)
public void setSumSquaredMeanDiff(double sumSquaredMeanDiff)
public static void main(java.lang.String[] args)