|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectxtc.util.Statistics
public class Statistics
Implementation of a simple statistics collector.
| Constructor Summary | |
|---|---|
Statistics()
Create a new statistics collector. |
|
| Method Summary | |
|---|---|
void |
add(double d)
Add the specified number. |
static double |
fitSlope(Statistics x,
Statistics y)
Compute the least squares fit. |
double |
get(int idx)
Get the specified number. |
double |
mean()
Calculate the mean. |
double |
median()
Calculate the median. |
void |
reset()
Reset this statistics collector. |
static double |
round(double d)
Round the specified number to two digits after the decimal point. |
int |
size()
Get the size of this collection. |
double |
stdev()
Calculate the standard deviation. |
double |
sum()
Calculate the sum. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Statistics()
| Method Detail |
|---|
public void reset()
public void add(double d)
d - The number.public int size()
public double get(int idx)
idx - The index.
java.lang.IndexOutOfBoundsException - Signals that the index is out of range.public double sum()
public double mean()
public double median()
public double stdev()
public static double round(double d)
d - The number.
public static double fitSlope(Statistics x,
Statistics y)
y = mx.
x - The collection of x coordinates.y - The collection of y coordiantes.
java.lang.IllegalArgumentException - Signals that the two collections
are empty or not of the same size.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||