vec_math
Class WeightedStatistic
java.lang.Object
vec_math.WeightedStatistic
- Direct Known Subclasses:
- ClassicStatistic
public abstract class WeightedStatistic
- extends Object
Abstract base class for statistic purpose. Defines routines getAverage()
to derive an average value (e.g. arithmetic average). Method getDeviation
to return something like a standard deviation. getSkew() and getKurt()
for higher order moments. If either the class's constructor or its setValue
method is called with null as the deviation array, the boolean Weighed is
set to false and an array holding 1.'s the same length as x is generated.
The methods getDeviationOfAverage returns the deviation of the average
(Deviation is the deviation of the individul measurements.
Due to the limited number of points in the sample two more routines are
provided: getTrueAverage and getTrueDeviation. Both return the same
value as the getAverage and getDeviation methods in the limiting case
N->inf. While the true average is normally not known, the true deviation
can sometimes be estimated. In any case it must be HIGHER than the apparent
Deviation returned by getDeviation.
Methods for adding and removing points are included. N holds the actual
number of points (public).
Comstructs either empty or with array of values.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SMALL
private static final double SMALL
- See Also:
- Constant Field Values
N
public int N
x
public double[] x
sigma
public double[] sigma
xValid
public boolean xValid
XMax
protected double XMax
XMin
protected double XMin
Weighed
protected boolean Weighed
Average
protected double Average
ValidAverage
protected boolean ValidAverage
TrueAverage
protected double TrueAverage
ValidTrueAverage
protected boolean ValidTrueAverage
DeviationOfAverage
protected double DeviationOfAverage
ValidDeviationOfAverage
protected boolean ValidDeviationOfAverage
Deviation
protected double Deviation
ValidDeviation
protected boolean ValidDeviation
TrueDeviation
protected double TrueDeviation
ValidTrueDeviation
protected boolean ValidTrueDeviation
Skew
protected double Skew
ValidSkew
protected boolean ValidSkew
Kurt
protected double Kurt
ValidKurt
protected boolean ValidKurt
WeightedStatistic
public WeightedStatistic()
WeightedStatistic
public WeightedStatistic(double[] val,
double[] sig)
- Parameters:
val - sig -
clear
public void clear()
setValue
public void setValue(double[] val,
double[] sig)
- Parameters:
val - sig -
addValue
public void addValue(double xadd)
- Parameters:
xadd -
addValue
public void addValue(double xadd,
double sigadd)
- Parameters:
xadd - sigadd -
deleteValue
public boolean deleteValue(double xdel)
- Parameters:
xdel -
- Returns:
- boolean
deleteValue
public boolean deleteValue(double xdel,
double sigdel)
- Parameters:
xdel - sigdel -
- Returns:
- boolean
deleteValue
public boolean deleteValue(int index)
- Parameters:
index -
- Returns:
- boolean
getMin
public double getMin()
- Returns:
- double
getMax
public double getMax()
setMinMax
private void setMinMax()
getSpan
public double getSpan()
- Returns:
- double
getAverage
public abstract double getAverage()
- Returns:
- double
getTrueAverage
public abstract double getTrueAverage()
- Returns:
- double
getDeviationOfAverage
public abstract double getDeviationOfAverage()
- Returns:
- double
getDeviation
public abstract double getDeviation()
- Returns:
- double
getTrueDeviation
public abstract double getTrueDeviation()
- Returns:
- double
getSkew
public abstract double getSkew()
- Returns:
- double
getKurt
public abstract double getKurt()
- Returns:
- double
updateOnDelete
public abstract void updateOnDelete(double xdel,
double sdel)
- Parameters:
xdel - sdel -
updateOnAdd
public abstract void updateOnAdd(double xadd,
double sadd)
- Parameters:
xadd - sadd -