Monad describing computations on fuzzy quantities, represented by a finite
probability distribution for the possible values. A distribution is
represented by a map from values to probabilities.
(defmonad dist-m
"Monad describing computations on fuzzy quantities, represented by a finite
probability distribution for the possible values. A distribution is
represented by a map from values to probabilities."
[m-result (fn m-result-dist [v]
{v 1})
m-bind (fn m-bind-dist [mv f]
(reduce (partial merge-with +)
(for [[x p] mv [y q] (f x)]
{y (* q p)})))
])
Comments top
No comments for dist-m. Log in to add a comment.