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.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/probabilities/finite_distributions.clj:28 top

(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)})))
   ])
Vars in clojure.contrib.probabilities.finite-distributions/dist-m:
Used in 0 other vars

Comments top

No comments for dist-m. Log in to add a comment.