[SciPy-Dev] Edge case bug in stats.triang?

Ted Pudlik tpudlik at gmail.com
Wed Apr 6 13:47:02 EDT 2016


I think this is indeed incorrect: the formula used to compute the pdf,
2*(1-x)/(1-c), produces nan because of a division by zero when x = c = 1.
I submitted an issue, https://github.com/scipy/scipy/issues/6036.

On Mon, Apr 4, 2016 at 11:35 PM Andrew Nelson <andyfaff at gmail.com> wrote:

> I've been investigating the stats.triang.pdf over it's domain with
> different modes:
>
> >>> from scipy.stats import triang
> >>> triang.pdf(0, 0)
> 2.0
> >>> triang.pdf(1, 1)
> nan
>
> Shouldn't the last value be 2?
>
> --
> _____________________________________
> Dr. Andrew Nelson
>
>
> _____________________________________
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/scipy-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20160406/e46be673/attachment.html>


More information about the SciPy-Dev mailing list