Skip to content

Latest commit

 

History

History
29 lines (19 loc) · 914 Bytes

README.md

File metadata and controls

29 lines (19 loc) · 914 Bytes

stanz

Build Status

Stanz is a scala library for purely functional Bayesian analysis.

Example

import com.github.sdual.stanz.Stanz._
import com.github.sdual.stanz.algorithm.{MetropolisHastings, MetropolisHastingsImpl}
import com.github.sdual.stanz.monad.Distribution

val mh: MetropolisHastings = MetropolisHastingsImpl()
val r = new Random
val n = 100000

val ps: Distribution[(Double, Double)] = points(createTrainingData(), linear())

val sampled = mh.run(n, ps).sample(r)

param-a param-b

References

  1. Practical Probabilistic Programming with Monads
  2. FUNCTIONAL PEARLS Probabilistic Functional Programming in Haskell