Message52242
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.
|
|
Date |
User |
Action |
Args |
2007-08-23 15:57:36 | admin | link | issue1681432 messages |
2007-08-23 15:57:36 | admin | create | |
|