Class KSStat


public class KSStat extends Statistic
Class for generating the Kolmogorov-Smirnov statistic.
  • Constructor Details

    • KSStat

      public KSStat(RealValuedFunctOps f)
      Constructor.
      Parameters:
      f - the cumulative distribution function that the data is to be tested against.
    • KSStat

      public KSStat(RealValuedFunctOps f, int n)
      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

      public KSStat(RealValuedFunctOps f, double[] array)
      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.
      Specified by:
      getValue in class Statistic
      Returns:
      the statistic.
    • getDistribution

      public ProbDistribution 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 class Statistic
      Returns:
      the probability distribution
    • add

      public void add(double d) throws IllegalStateException
      Add data.
      Parameters:
      d - a value to add to the data set
      Throws:
      IllegalStateException - additional data cannot be added
    • add

      public void add(double[] array) throws IllegalStateException
      Add multiple data points.
      Parameters:
      array - a value to add to the data set
      Throws:
      IllegalStateException - additional data cannot be added