[SciPy-Dev] scipy.stats: algorithm to for ticket 1493

josef.pktd at gmail.com josef.pktd at gmail.com
Mon May 14 14:08:02 EDT 2012


On Mon, May 14, 2012 at 1:56 PM, nicky van foreest <vanforeest at gmail.com> wrote:
>> one case I was worried about, but works well:
>>
>>>>> p,r = optimize.brentq(lambda x: np.minimum(1, np.maximum(x,0)) -1e-30, -1000, 1000, full_output=1)
>>>>> p
>> -1.2079226507921669e-12
>
> Nice example. The answer is negative, while it should be positive, but
> the answer is within numerical accuracy I would say.

oops, didn't we have a case with negative sign already ?
maybe a check self.a <= p <= self.b  ?

>
>> I don't see anything yet to criticize in your latest version :(
>
> Ok. I just checked the tests in scipy/stats/tests.

If you are curious, you could temporarily go closer to q=0 and q=1 in
the tests for ppf, and see whether it breaks for any distribution.

> It seems that these
> need not be changed. Thus I propose to do the following
>
> - make a new branch
> - repair for the cases q =  0 and q = 1 by means of an explicit test.

isn't ppf (generic part) taking care of this, if not then it should, I think

ppf(0) = self.a
ppf(1) = self.b

> - implement findppf in a suitable way in distributions.py
> - remove xa and xb
> - send a pull request
>
> In case this list is not complete, please let me know. Otherwise
> you'll see the pull request

sounds good.

Josef
<maintenance worker for statsmodels>

>
> Nicky
>
> In case I m
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev



More information about the SciPy-Dev mailing list