JuliaStats/Distributions.jl — pull request #305 by lindahua (2014-11-08 09:17:52+00:00)
Title: Add probs methods to discrete distributions

Computing pmf over a contiguous range can take advantage of the recursive relations in the pmf formula, and thus can be much more efficient than computing them individually using `pdf`.

Hence, I introduce the `probs` function for discrete distribution, with the following semantics:

```julia
probs(d, a:b) # return a vector of probabilities corresponding to each value in the range a:b
probs(d) # only for bounded distributions, equivalent to probs(minimum(d):maximum(d))
```

This function can be used to get an entire probability vector efficiently.