|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectvec_math.WeightedStatistic
vec_math.ClassicStatistic
public class ClassicStatistic
Class to implement a simple statistic: Average is the arithmetic average, Deviation the standard deviation. For definition of Skew see e.g. "Numerical recipes" p
| Nested Class Summary | |
|---|---|
static class |
ClassicStatistic.FileStatistic
A class to read in an ascii-column file and calculate average, sigma and so forth from the specified column. |
| Field Summary | |
|---|---|
protected boolean |
ValidWeighSum
|
protected double |
WeighSum
|
| Fields inherited from class vec_math.WeightedStatistic |
|---|
Average, Deviation, DeviationOfAverage, Kurt, N, sigma, Skew, TrueAverage, TrueDeviation, ValidAverage, ValidDeviation, ValidDeviationOfAverage, ValidKurt, ValidSkew, ValidTrueAverage, ValidTrueDeviation, Weighed, x, XMax, XMin, xValid |
| Constructor Summary | |
|---|---|
ClassicStatistic()
Constructs an empty statistic object. |
|
ClassicStatistic(double[] x,
double[] s)
Constructs a ready-to-use statistic object. |
|
ClassicStatistic(Number[] x,
Number[] s)
Constructs a ready-to-use statistic object out of Double objects. |
|
ClassicStatistic(VectorG[] val,
int vi,
int si)
Constructs a ready-to-use statistic object out of a VectorG. |
|
| Method Summary | |
|---|---|
private static double[] |
getAsPrimitiveArray(Number[] z)
Converts an array of Doubles into an array of its primitive type. |
double |
getAverage()
Returns the weighed, aritmethic average. |
double |
getAverageSigma()
|
double |
getDeviation()
Return the standard deviation for beforehandly unknown Average. |
double |
getDeviationOfAverage()
Estimate the Deviaiton of the Average as Deviaiton/sqrt(N). |
double |
getKurt()
Returns the kurt of a distribution. |
protected int |
getNum()
Returns the number of data. |
double |
getSkew()
Returns the skew of a sample. |
protected double |
getSum()
Calculates the Sum of the weighs and sets Valid flag. |
double |
getTrueAverage()
Not calcable, return NaN. |
double |
getTrueDeviation()
Approximate the true deviation (as for N->inf.) bye multiplying the Deviation with sqrt(N/(N-1)). |
void |
updateOnAdd(double xadd,
double sadd)
Only possible update is to recalculate everything from plain data. |
void |
updateOnDelete(double xdel,
double sdel)
Exactly the same rules as with adding, so simply call that routine. |
| Methods inherited from class vec_math.WeightedStatistic |
|---|
addValue, addValue, clear, deleteValue, deleteValue, deleteValue, getMax, getMin, getSpan, setValue |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected double WeighSum
protected boolean ValidWeighSum
| Constructor Detail |
|---|
public ClassicStatistic()
WeightedStatistic.addValue(double) method.
public ClassicStatistic(double[] x,
double[] s)
getAverage()
x - The data set.s - The weighs of the data or null if unweighed.
public ClassicStatistic(Number[] x,
Number[] s)
getAverage()
x - The data set.s - The weighs of the data or null if unweighed.
public ClassicStatistic(VectorG[] val,
int vi,
int si)
getAverage()
val - The data set with values and weights at some index.vi - The index in a single VectorG that has the data.si - Index in a single VectorG that has the weight or -1 for none.| Method Detail |
|---|
protected int getNum()
protected double getSum()
public double getAverageSigma()
public double getAverage()
getAverage in class WeightedStatisticpublic double getTrueAverage()
getTrueAverage in class WeightedStatisticpublic double getDeviationOfAverage()
getDeviationOfAverage in class WeightedStatisticpublic double getDeviation()
getDeviation in class WeightedStatisticpublic double getTrueDeviation()
getTrueDeviation in class WeightedStatisticpublic double getSkew()
getSkew in class WeightedStatisticpublic double getKurt()
getKurt in class WeightedStatistic
public void updateOnAdd(double xadd,
double sadd)
updateOnAdd in class WeightedStatisticxadd - The value added.sadd - The weigh of the added value.
public void updateOnDelete(double xdel,
double sdel)
updateOnDelete in class WeightedStatisticxdel - The value deleted.sdel - The weigh of the deleted value.private static final double[] getAsPrimitiveArray(Number[] z)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||