public class KolmogorovSmirnovEvaluator extends AbstractStatefulEvaluator<java.lang.Double,java.lang.Double,FiniteCapacityBuffer<java.lang.Double>>
Modifier and Type | Field and Description |
---|---|
protected CumulativeDistributionFunction<java.lang.Double> |
cdf
The cumulative distribution function to base the evaluator on.
|
static int |
DEFAULT_CAPACITY
Default capacity, 100.
|
static CumulativeDistributionFunction<java.lang.Double> |
DEFAULT_CDF
Default CDF, a 3-DOF Chi-Square.
|
Constructor and Description |
---|
KolmogorovSmirnovEvaluator()
Creates a new
KolmogorovSmirnovEvaluator . |
KolmogorovSmirnovEvaluator(CumulativeDistributionFunction<java.lang.Double> cdf,
int capacity)
Creates a new
KolmogorovSmirnovEvaluator . |
Modifier and Type | Method and Description |
---|---|
KolmogorovSmirnovEvaluator |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
FiniteCapacityBuffer<java.lang.Double> |
createDefaultState()
Creates a new default state object.
|
java.lang.Double |
evaluate(java.lang.Double value)
takes in the double value and adds it to finite capacity buffer
then computes the KS null hypothesis probability on the samples
in the buffer against the particular CDF specified.
|
int |
getCapacity()
Getter for capacity
|
CumulativeDistributionFunction<java.lang.Double> |
getCDF()
Getter for cdf
|
void |
setCapacity(int capacity)
Setter for capacity
|
void |
setCDF(CumulativeDistributionFunction<java.lang.Double> cdf)
Setter for cdf
|
evaluate, getState, resetState, setState
public static final int DEFAULT_CAPACITY
public static final CumulativeDistributionFunction<java.lang.Double> DEFAULT_CDF
protected CumulativeDistributionFunction<java.lang.Double> cdf
public KolmogorovSmirnovEvaluator()
KolmogorovSmirnovEvaluator
.public KolmogorovSmirnovEvaluator(CumulativeDistributionFunction<java.lang.Double> cdf, int capacity)
KolmogorovSmirnovEvaluator
.cdf
- The cumulative distribution function to base the evaluator on.capacity
- The capacity of the state.public KolmogorovSmirnovEvaluator clone()
AbstractCloneableSerializable
Object
class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone()
to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil
may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone()
as the basis for your implementation.clone
in interface CloneableSerializable
clone
in class AbstractStatefulEvaluator<java.lang.Double,java.lang.Double,FiniteCapacityBuffer<java.lang.Double>>
public java.lang.Double evaluate(java.lang.Double value)
value
- a sample valuepublic CumulativeDistributionFunction<java.lang.Double> getCDF()
public void setCDF(CumulativeDistributionFunction<java.lang.Double> cdf)
cdf
- The cumulative distribution function to base the evaluator on.public FiniteCapacityBuffer<java.lang.Double> createDefaultState()
StatefulEvaluator
public int getCapacity()
public void setCapacity(int capacity)
capacity
- The capacity of the state.