aboutsummaryrefslogtreecommitdiff
path: root/src/clojure/contrib/probabilities
diff options
context:
space:
mode:
authorKonrad Hinsen <konrad.hinsen@laposte.net>2009-05-03 15:45:02 +0000
committerKonrad Hinsen <konrad.hinsen@laposte.net>2009-05-03 15:45:02 +0000
commitbdc813a0d39cb3c6184c4e123d847458e9c77711 (patch)
treebfd2af2560617b72f4b8f827b5e7467770637230 /src/clojure/contrib/probabilities
parent47a2f69414f0c3ff90fb2fad4930d9af3d491d23 (diff)
Namespace documentation for autodoc
Diffstat (limited to 'src/clojure/contrib/probabilities')
-rw-r--r--src/clojure/contrib/probabilities/examples_finite_distributions.clj18
-rw-r--r--src/clojure/contrib/probabilities/examples_monte_carlo.clj6
-rw-r--r--src/clojure/contrib/probabilities/finite_distributions.clj9
-rw-r--r--src/clojure/contrib/probabilities/monte_carlo.clj40
-rw-r--r--src/clojure/contrib/probabilities/random_numbers.clj21
5 files changed, 57 insertions, 37 deletions
diff --git a/src/clojure/contrib/probabilities/examples_finite_distributions.clj b/src/clojure/contrib/probabilities/examples_finite_distributions.clj
index ca301654..56f25bad 100644
--- a/src/clojure/contrib/probabilities/examples_finite_distributions.clj
+++ b/src/clojure/contrib/probabilities/examples_finite_distributions.clj
@@ -6,13 +6,17 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(ns clojure.contrib.probabilities.examples-finite-distributions
- (:use [clojure.contrib.probabilities.finite-distributions
- :only (uniform prob cond-prob join-with dist-m choose
- normalize certainly cond-dist-m normalize-cond)])
- (:use [clojure.contrib.monads
- :only (domonad with-monad m-seq m-chain m-lift)])
- (:require clojure.contrib.accumulators))
+(ns
+ #^{:author "Konrad Hinsen"
+ :skip-wiki true
+ :doc "Examples for finite probability distribution"}
+ clojure.contrib.probabilities.examples-finite-distributions
+ (:use [clojure.contrib.probabilities.finite-distributions
+ :only (uniform prob cond-prob join-with dist-m choose
+ normalize certainly cond-dist-m normalize-cond)])
+ (:use [clojure.contrib.monads
+ :only (domonad with-monad m-seq m-chain m-lift)])
+ (:require clojure.contrib.accumulators))
;; Simple examples using dice
diff --git a/src/clojure/contrib/probabilities/examples_monte_carlo.clj b/src/clojure/contrib/probabilities/examples_monte_carlo.clj
index 13796e2f..44c6a7e2 100644
--- a/src/clojure/contrib/probabilities/examples_monte_carlo.clj
+++ b/src/clojure/contrib/probabilities/examples_monte_carlo.clj
@@ -6,7 +6,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(ns clojure.contrib.probabilities.random.examples-monte-carlo
+(ns
+ #^{:author "Konrad Hinsen"
+ :skip-wiki true
+ :doc "Examples for monte carlo methods"}
+ clojure.contrib.probabilities.random.examples-monte-carlo
(:require [clojure.contrib.generic.collection :as gc])
(:use [clojure.contrib.probabilities.random-numbers
:only (lcg rand-stream)])
diff --git a/src/clojure/contrib/probabilities/finite_distributions.clj b/src/clojure/contrib/probabilities/finite_distributions.clj
index 3b76b318..d1023bac 100644
--- a/src/clojure/contrib/probabilities/finite_distributions.clj
+++ b/src/clojure/contrib/probabilities/finite_distributions.clj
@@ -1,7 +1,7 @@
;; Finite probability distributions
;; by Konrad Hinsen
-;; last updated April 16, 2009
+;; last updated May 3, 2009
;; Copyright (c) Konrad Hinsen, 2009. All rights reserved. The use
;; and distribution terms for this software are covered by the Eclipse
@@ -11,7 +11,12 @@
;; agreeing to be bound by the terms of this license. You must not
;; remove this notice, or any other, from this software.
-(ns clojure.contrib.probabilities.finite-distributions
+(ns
+ #^{:author "Konrad Hinsen"
+ :doc "Finite probability distributions
+ This library defines a monad for combining finite probability
+ distributions."}
+ clojure.contrib.probabilities.finite-distributions
(:use [clojure.contrib.monads
:only (defmonad domonad with-monad maybe-t m-lift m-chain)]
[clojure.contrib.def :only (defvar)]))
diff --git a/src/clojure/contrib/probabilities/monte_carlo.clj b/src/clojure/contrib/probabilities/monte_carlo.clj
index 83bda5bf..6e140a48 100644
--- a/src/clojure/contrib/probabilities/monte_carlo.clj
+++ b/src/clojure/contrib/probabilities/monte_carlo.clj
@@ -1,7 +1,7 @@
;; Monte-Carlo algorithms
;; by Konrad Hinsen
-;; last updated April 21, 2009
+;; last updated May 3, 2009
;; Copyright (c) Konrad Hinsen, 2009. All rights reserved. The use
;; and distribution terms for this software are covered by the Eclipse
@@ -11,24 +11,26 @@
;; agreeing to be bound by the terms of this license. You must not
;; remove this notice, or any other, from this software.
-(ns 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.
- "
+(ns
+ #^{:author "Konrad Hinsen"
+ :doc "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."}
+ clojure.contrib.probabilities.monte-carlo
(:use [clojure.contrib.macros :only (const)])
(:use [clojure.contrib.types :only (deftype)])
(:use [clojure.contrib.stream-utils :only (defstream stream-next)])
diff --git a/src/clojure/contrib/probabilities/random_numbers.clj b/src/clojure/contrib/probabilities/random_numbers.clj
index 451a10c5..bf6372f0 100644
--- a/src/clojure/contrib/probabilities/random_numbers.clj
+++ b/src/clojure/contrib/probabilities/random_numbers.clj
@@ -1,7 +1,7 @@
;; Random number generators
;; by Konrad Hinsen
-;; last updated April 16, 2009
+;; last updated May 3, 2009
;; Copyright (c) Konrad Hinsen, 2009. All rights reserved. The use
;; and distribution terms for this software are covered by the Eclipse
@@ -11,14 +11,19 @@
;; agreeing to be bound by the terms of this license. You must not
;; remove this notice, or any other, from this software.
-(ns clojure.contrib.probabilities.random-numbers
- "Random number streams
+(ns
+ #^{:author "Konrad Hinsen"
+ :doc "Random number streams
- This library provides various random number generators with a common
- stream interface. They all produce pseudo-random numbers that are uniformly
- distributed in the interval [0, 1), i.e. 0 is a possible value but 1 isn't.
- For transformations to other distributions, see
- clojure.contrib.probabilities.monte-carlo."
+ This library provides random number generators with a common
+ stream interface. They all produce pseudo-random numbers that are
+ uniformly distributed in the interval [0, 1), i.e. 0 is a
+ possible value but 1 isn't. For transformations to other
+ distributions, see clojure.contrib.probabilities.monte-carlo.
+
+ At the moment, the only generator provided is a rather simple
+ linear congruential generator."}
+ clojure.contrib.probabilities.random-numbers
(:use [clojure.contrib.types :only (deftype)])
(:use [clojure.contrib.stream-utils :only (defstream)])
(:use [clojure.contrib.def :only (defvar)]))