JuliaStats/Distributions.jl — pull request #66 by mewo2 (2013-05-24 16:39:32+00:00)
Title: RFC: First run at a truncation operator

This is a first pass at a truncation operator for continuous distributions (as discussed in #65). No tests as yet, but it does seem to more or less work. The idea is that you can do things like this, with arbitrary input distributions and ranges:
```
d = Rayleigh()
truncated = truncate(d, 4, 5)
r = rand(truncated)
```
It's not immediately obvious to me that there's a way of getting the moments of a truncated distribution without numerically integrating them - at the very least this means we'll have to rewrite the `show` method for truncated distributions.