Skip to content

Bug in Tri() constructor for triangular distribution #4

@emarsden

Description

@emarsden

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions