Return the probability that the predicate pred is satisfied in the
distribution dist, i.e. the sum of the probabilities of the values
that satisfy pred.
(defn prob "Return the probability that the predicate pred is satisfied in the distribution dist, i.e. the sum of the probabilities of the values that satisfy pred." [pred dist] (apply + (for [[x p] dist :when (pred x)] p)))
Comments top
No comments for prob. Log in to add a comment.