soerp icon indicating copy to clipboard operation
soerp copied to clipboard

Bug in Tri() constructor for triangular distribution

Open emarsden opened this issue 8 years ago • 0 comments

The constructor for triangular distributions, Tri(a, b, c) is calling scipy.stats.triang as follows:

return uv(rv=ss.triang(c, loc=a, scale=b-a), tag=tag)

where a and b are respectively the min and max of the distribution and c is the peak. However, even if this is not clear from the SciPy documentation, the first argument to scipy.stats.triang should be between 0 and 1. That line should read something like

return uv(rv=ss.triang((c-a)/float(b-a), loc=a, scale=b-a), tag=tag)

emarsden avatar Jan 31 '16 13:01 emarsden