public class Statistics
extends java.lang.Object
| Constructor and Description |
|---|
Statistics()
Create a new statistics collector.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
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.Copyright © 2014. All Rights Reserved.