Author mark.dickinson
Recipients
Date 2007-03-17.16:54:29
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Looks correct to me, and seems to work well with correct parameters.

The arguments to the square roots are never negative; this means that we get silent failure (that is, some distribution that isn't the triangular distribution) if the input parameters don't satisfy left <= center <= right.  Maybe the inputs should be checked, and a
ValueError raised on bad input?

If the test "x < (center-left)/(right-left)" is replaced by "x*(right-left) < (center - left)" then the code does the right thing in the limit-case when left == center == right (that is, it gives a delta distribution at center);  currently it'll raise a ZeroDivisionError in this case.  It's not clear to me which behaviour should be preferred.


History
Date User Action Args
2007-08-23 15:57:36adminlinkissue1681432 messages
2007-08-23 15:57:36admincreate