Package smile.stat

Class GoodTuring

java.lang.Object
smile.stat.GoodTuring

public class GoodTuring extends Object
Good–Turing frequency estimation. This technique is for estimating the probability of encountering an object of a hitherto unseen species, given a set of past observations of objects from different species. In drawing balls from an urn, the 'objects' would be balls and the 'species' would be the distinct colors of the balls (finite but unknown in number). After drawing R_red red balls, R_black black balls and , R_green green balls, we would ask what is the probability of drawing a red ball, a black ball, a green ball or one of a previously unseen color.

This method takes a set of (frequency, frequency-of-frequency) pairs and estimate the probabilities corresponding to the observed frequencies, and P0, the joint probability of all unobserved species.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final double[]
    The probabilities corresponding to the observed frequencies.
    final double
    The joint probability of all unobserved species.
  • Method Summary

    Modifier and Type
    Method
    Description
    static GoodTuring
    of(int[] r, int[] Nr)
    Good–Turing frequency estimation.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • p

      public final double[] p
      The probabilities corresponding to the observed frequencies.
    • p0

      public final double p0
      The joint probability of all unobserved species.
  • Method Details

    • of

      public static GoodTuring of(int[] r, int[] Nr)
      Good–Turing frequency estimation.
      Parameters:
      r - the frequency in ascending order.
      Nr - the frequency of frequencies.
      Returns:
      the estimation object.