[SciPy-dev] nbinom.ppf
josef.pktd@gmai...
josef.pktd@gmai...
Sat Aug 1 15:10:06 CDT 2009
On Sat, Aug 1, 2009 at 11:29 AM, <josef.pktd@gmail.com> wrote:
> On Tue, Jul 28, 2009 at 12:56 PM, Robert Kern<robert.kern@gmail.com> wrote:
>> On Mon, Jul 27, 2009 at 20:11, <josef.pktd@gmail.com> wrote:
>>> That's better. It took me a while to understand the logic behind the
>>> way the ceiling error is corrected. The same pattern is also followed
>>> by the other discrete distributions that define a _ppf method. It is
>>> cleaner then the epsilon correction, but takes longer to figure out
>>> what it does.
>>>
>>> To understand the logic more easily and to be DRY, it would be better
>>> to replace the duplication of the _cdf method directly with a call to
>>> self._cdf.
>>> For example, in changeset 4673, Robert, you changed the _cdf method to
>>> use betainc instead of nbdtr, but not the _ppf method. Without the
>>> code duplication, partial corrections could be more easily avoided.
>>>
>>> Is there a reason not to call self._cdf instead?
>>
>> Nope. Go ahead.
>>
>> --
>> Robert Kern
>>
>> "I have come to believe that the whole world is an enigma, a harmless
>> enigma that is made terrible by our own mad attempt to interpret it as
>> though it had an underlying truth."
>> -- Umberto Eco
>> _______________________________________________
>> Scipy-dev mailing list
>> Scipy-dev@scipy.org
>> http://mail.scipy.org/mailman/listinfo/scipy-dev
>>
>
>
> for the record: dlaplace and boltzman also fail the roundtrip test
>
> boltzmann (1.3999999999999999, 19)
> [ 1. 2. 3. 3.]
> [ 0. 1. 2. 3.]
> False True False [ 0. 3.]
> dlaplace (0.80000000000000004,)
> [-5. -4. -3. -2. -1. 1. 1. 2. 3. 4. 5.]
> [-5. -4. -3. -2. -1. 0. 1. 2. 3. 4. 5.]
>
> Josef
>
and planck
>>> stats.planck.ppf(stats.planck.cdf(np.arange(10),.51),.51)
array([ 1., 1., 2., 3., 4., 5., 7., 7., 8., 10.])
fixed in 5889
Josef
More information about the Scipy-dev
mailing list