java.lang.Object
org.bzdev.math.stats.Statistic
org.bzdev.math.stats.KSStat
Class for generating the Kolmogorov-Smirnov statistic.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bzdev.math.stats.Statistic
Statistic.PValueMode
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.KSStat
(RealValuedFunctOps f, double[] array) Constructor with an initial data set.KSStat
(RealValuedFunctOps f, int n) Constructor with an estimate of the data-set size. -
Method Summary
Methods inherited from class org.bzdev.math.stats.Statistic
getBeta, getBeta, getCriticalValue, getDistribution, getNCParameter, getNCParameter, getPower, getPower, getPValue, optimalValue
-
Constructor Details
-
KSStat
Constructor.- Parameters:
f
- the cumulative distribution function that the data is to be tested against.
-
KSStat
Constructor with an estimate of the data-set size.- Parameters:
f
- the cumulative distribution function that the data is to be tested against.n
- an estimate of the data-set size
-
KSStat
Constructor with an initial data set. More data may be added until size() or getStatistic() is called.- Parameters:
f
- the cumulative distribution function that the data is to be tested against.array
- the initial data set
-
-
Method Details
-
size
public int size()Get the size of the data set.- Returns:
- the number of data points
-
getValue
public double getValue()Get the Kolmogorov-Smirnov test statistic Dn. -
getDistribution
Description copied from class:Statistic
Get the probability distribution for this statistic. The distribution is the distribution for the statistic, not the the distribution for the data the statistic describes.- Specified by:
getDistribution
in classStatistic
- Returns:
- the probability distribution
-
add
Add data.- Parameters:
d
- a value to add to the data set- Throws:
IllegalStateException
- additional data cannot be added
-
add
Add multiple data points.- Parameters:
array
- a value to add to the data set- Throws:
IllegalStateException
- additional data cannot be added
-