API for probabilities.finite-distributions - clojure-contrib v1.1 (stable)

by Konrad Hinsen

clojure-contrib is now deprecated

clojure-contrib is no longer being developed or maintained.

Rather than a single, monolithic, contributions library, Clojure now has a set of separate libraries for each unit of functionality. The libraries are in the Clojure GitHub organization at https://github.com/clojure. API documentation of the libraries can be found at https://clojure.github.io.

If you're looking for a specific function or namespace from the old clojure-contrib, see "Where Did Clojure.Contrib Go".


Full namespace name: clojure.contrib.probabilities.finite-distributions

Overview

Finite probability distributions
This library defines a monad for combining finite probability
distributions.

Public Variables and Functions



certainly

function
This library, clojure-contrib, is deprecated. See here for more information.
Usage: (certainly v)
Returns a distribution in which the single value v has probability 1.
Source


choose

function
This library, clojure-contrib, is deprecated. See here for more information.
Usage: (choose & choices)
Construct a distribution from an explicit list of probabilities
and values. They are given in the form of a vector of probability-value
pairs. In the last pair, the probability can be given by the keyword
:else, which stands for 1 minus the total of the other probabilities.
Source


cond-dist-m

var
This library, clojure-contrib, is deprecated. See here for more information.

  
Variant of the dist monad that can handle undefined values.
Source


cond-prob

function
This library, clojure-contrib, is deprecated. See here for more information.
Usage: (cond-prob pred dist)
Returns the conditional probability for the values in dist that satisfy
the predicate pred.
Source


dist-m

var
This library, clojure-contrib, is deprecated. See here for more information.

  
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.
Source


join-with

function
This library, clojure-contrib, is deprecated. See here for more information.
Usage: (join-with f dist1 dist2)
Returns the distribution of (f x y) with x from dist1 and y from dist2.
Source


make-distribution

function
This library, clojure-contrib, is deprecated. See here for more information.
Usage: (make-distribution coll f)
Returns the distribution in which each element x of the collection
has a probability proportional to (f x)
Source


normalize

function
This library, clojure-contrib, is deprecated. See here for more information.
Usage: (normalize weights)
Convert a weight map (e.g. a map of counter values) to a distribution
by multiplying with a normalization factor. If the map has a key
:total, its value is assumed to be the sum over all the other values and
it is used for normalization. Otherwise, the sum is calculated
explicitly. The :total key is removed from the resulting distribution.
Source


prob

function
This library, clojure-contrib, is deprecated. See here for more information.
Usage: (prob pred dist)
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.
Source


uniform

function
This library, clojure-contrib, is deprecated. See here for more information.
Usage: (uniform coll)
Return a distribution in which each of the elements of coll
has the same probability.
Source


zipf

function
This library, clojure-contrib, is deprecated. See here for more information.
Usage: (zipf s n)
Returns the Zipf distribution in which the numbers k=1..n have
probabilities proportional to 1/k^s.
Source
Logo & site design by Tom Hickey.
Clojure auto-documentation system by Tom Faulhaber.