You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Odds is a small domain-specific language (DSL) for
probabilistic programming,
embedded in Scala. Odds provides
first-class support for random variables and probabilistic choice,
within Scala's powerful type system. Odds programs are actually Scala
programs, which means that all of Scala's abstraction and modularity
facilities can be used to compose probabilistic computations and to
specify deterministic program parts.
Installation
Odds is written in Scala, which runs on the JVM. So for starters,
you'll need an up-to-date JRE/JDK. If
you're on a Debian/Ubuntu system, this should do the trick:
Go into the root directory and compile the source code using SBT:
$ cd odds
$ sbt compile
Run sbt test to run the test suite.
Run sbt publish-local to install the Odds library for use in
other projects.
Examples
Have a look at the various test cases in the core/test/ directory.
Many of them are Odds example programs, illustrating how to write an
Odds program and perform inference on it.
Documentation
To build the API docs, run sbt doc. You can find the generated API
docs in the core/target/scala-2.10/api/ directory.
Our Scala'13 paper also
contains an introduction to Odds and describes the principles it is
built on. The source code of Odds has changed quite a bit since
Scala'13, but the original source code (on which the paper was based)
is available here.