[SciPy-User] Triangular Distribution ppf method

Travis Oliphant oliphant@enthought....
Tue Jun 8 23:41:29 CDT 2010

On May 25, 2010, at 7:33 PM, Leon Adams wrote:

> Hi all,
> There seems to be a bug of some sort in evaluating the ppf method of the scipy.stats.triang.ppf function. Evaluating the distribution with a location parameter 1 or greater seems to problematic. I am looking for confirmation on this behavior and suggestions for work around.

Make sure you understand the shape parameter for this distribution and how the location and scale parameter interact with it.  The required shape parameter is the peak of the pdf as a percentage of the width.    The location parameter is the start of the non-zero portion of the triangular-shaped pdf.   The scale parameter is the width of the non-zero portion of the pdf. 

>>> from scipy.stats import triang

>>> triang.ppf([0.1, 0.5, 0.8], 0.5, loc=20, scale=10)
array([ 22.23606798,  25.        ,  26.83772234])


More information about the SciPy-User mailing list