Usage:

```
(ns your-namespace
(:require clojure.contrib.probabilities.monte-carlo))
```

Monte-Carlo method support Monte-Carlo methods transform an input random number stream (usually having a continuous uniform distribution in the interval [0, 1)) into a random number stream whose distribution satisfies certain conditions (usually the expectation value is equal to some desired quantity). They are thus transformations from one probability distribution to another one. This library represents a Monte-Carlo method by a function that takes as input the state of a random number stream with uniform distribution (see clojure.contrib.probabilities.random-numbers) and returns a vector containing one sample value of the desired output distribution and the final state of the input random number stream. Such functions are state monad values and can be composed using operations defined in clojure.contrib.monads.

Usage: (discrete dist)

A discrete distribution, defined by a map dist mapping values to probabilities. The sum of probabilities must be one.Source

Usage: (exponential lambda)

Transform a sequence of uniform random numbers in the interval [0, 1) into a sequence of exponential random numbers with parameter lambda.Source

Usage: (lognormal mu sigma)

Transform a sequence of uniform random numbesr in the interval [0, 1) into a sequence of lognormal random numbers with mean mu and standard deviation sigma.Source

Usage: (n-sphere n r)

Return a uniform distribution of n-dimensional vectors inside an n-sphere of radius r.Source

Usage: (normal mu sigma)

Transform a sequence urs of uniform random number in the interval [0, 1) into a sequence of normal random numbers with mean mu and standard deviation sigma.Source

Usage: (normal-box-muller mu sigma)

Transform a sequence of uniform random numbers in the interval [0, 1) into a sequence of normal random numbers with mean mu and standard deviation sigma.Source

Usage: (random-stream distribution random-stream-state)

Define a random stream by a distribution and the state of a random number stream with uniform distribution in [0, 1).Source

Usage: (reject p dist)

Return the distribution that results from rejecting the values from dist that do not satisfy predicate p.Source

Usage: (sample n dist)

Return the distribution of samples of length n from the distribution distSource

Usage: (sample-mean n dist)

Return the distribution of the mean over n samples from the distribution distSource

Usage: (sample-mean-variance n dist)

Return the distribution of the mean-and-variance (a vector containing the mean and the variance) over n samples from the distribution distSource

Usage: (sample-reduce f n dist) (sample-reduce f val n dist)

Returns the distribution of the reduction of f over n samples from the distribution dist.Source

Usage: (sample-sum n dist)

Return the distribution of the sum over n samples from the distribution dist.Source

Copyright 2007-2009 by Rich Hickey and the various contributors

Logo & site design by Tom Hickey.

Clojure auto-documentation system by Tom Faulhaber.

Clojure auto-documentation system by Tom Faulhaber.