Hey Conrad, this is great. The only suggestion I'd make is that often
times you want a probability distribution which is updatable over
time. This happens in online learning as well as Gibbs sampling where
you always only implicitly store the posterior b/c it's changing
constantly.  So in my research code, I typically seperate the
sufficient statistics of a distribution (raw counts in the case of a
multinomial as well as a total count to avoid wasteful re-
computations) from the logic of yielding a probability (in the case of
multinomials just return count/total-count).  This way it's easy to
update distributions and make changes on the fly such as altering your
smoothing parameters.

On Jan 8, 1:54 am, Konrad Hinsen <konrad.hin...@laposte.net> wrote:
> I have just added a new module for handling (finite) probability  
> distributions to clojure-contrib. Some examples are included as well,  
> but for those who want to see the examples without downloading the  
> clojure-contrib source code, I also uploaded them to the files  
> section of this group:
>
>        http://groups.google.com/group/clojure/web/
> probability_distributions.clj
>
> This module was initially inspired by the PFP library for Haskell  
> (seehttp://web.engr.oregonstate.edu/~erwig/pfp/, and in particular  
> the first paper under "further information"), but ended up being  
> quite different:
>
> 1) PFP uses lists of (value probability) pairs to represent  
> distributions. Clojure's maps are a more natural fit, so I use maps  
> from values to probabilities.
>
> 2) At the moment, I have only implemented deterministic  
> transformations of finite probability distributions. PFP also offers  
> random sampling, which I plan to add in the future.
>
> 3) I added a second monad, cond-dist, which allows a straightforward  
> implementation of Bayesian filters.
>
> 4) A significant part of the PFP code does nothing else but hide the  
> implementation details behind a few abstract data types. This makes  
> the code much more difficult to understand. In Clojure we don't have  
> to deal with types, so this overhead disappears.
>
> Any feedback is welcome, as always!
>
> Konrad.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to