extract_distribution function

Extract a distribution represented by samples