'Use the Lidstone estimate to create a probability distribution
for the experiment used to generate ``freqdist``.
:type freqdist: FreqDist
:param freqdist: The frequency distribution that the
probability estimates should be based on.
:type gamma: float
:param gamma: A real number used to parameterize the
estimate.  The Lidstone estimate is equivalent to adding
*gamma* to the count for each bin, and taking the
maximum likelihood estimate of the resulting frequency
distribution.
:type bins: int
:param bins: The number of sample values that can be generated
by the experiment that is described by the probability
distribution.  This value must be correctly set for the
probabilities of the sample values to sum to one.  If
``bins`` is not specified, it defaults to ``freqdist.B()``.'

def __init__(self, freqdist, gamma, bins=None):

    if ((bins == 0) or ((bins is None) and (freqdist.N() == 0))):
        name = self.__class__.__name__[:(-8)]
        raise ValueError(((u'A    %s    probability    distribution    ' % name) + u'must    have    at    least    one    bin.'))
    if ((bins is not None) and (bins < freqdist.B())):
        name = self.__class__.__name__[:(-8)]
        raise ValueError(((((u'\nThe    number    of    bins    in    a    %s    distribution    ' % name) + (u'(%d)    must    be    greater    than    or    equal    to\n' % bins)) + u'the    number    of    bins    in    the    FreqDist    used    ') + (u'to    create    it    (%d).' % freqdist.B())))
    self._freqdist = freqdist
    self._gamma = float(gamma)
    self._N = self._freqdist.N()
    if (bins is None):
        bins = freqdist.B()
    self._bins = bins
    self._divisor = (self._N + (bins * gamma))
    if (self._divisor == 0.0):
        self._gamma = 0
        self._divisor = 1
