Returns the conditional probability for the values in dist that satisfy
the predicate pred.
(with-monad cond-dist-m
(defn cond-prob
"Returns the conditional probability for the values in dist that satisfy
the predicate pred."
[pred dist]
(normalize-cond
(domonad
[v dist
:when (pred v)]
v))))
Comments top
No comments for cond-prob. Log in to add a comment.