extract_pmf function

Extract probability mass function from vector of samples