Skip to content
0:00 / 0:00

#haskell#monads#probabilitymonad

The Probability Monad

Compose Conference

2.9K subscribers • 30 videos on Hallway

YouTube
  • Recommended by 1 person: 1 in engineering communities.
  • Presented by Tikhon Jelvis

Intermediate. Assumes working knowledge.

8.6K views9 years ago1 recommendation

Programming languagesComputer scienceHaskellFunctional programmingAlgorithms

Tikhon Jelvis explains how a discrete probability distribution monad works in Haskell and its application to supply chain optimization.

Tikhon Jelvis C◦mp◦se :: Conference composeconference.org/2017/ May 18, 2017 Probability distributions form a monad, giving us a lightweight, surprisingly simple probabilistic language embedded in Haskell. We can write stochastic models as normal Haskell programs and then interpret them either exhaustively or by random sampling. I’ll give an in-depth explanation of how a simple discrete probability distribution monad works, along with real-world examples from my work on supply chain optimization at Target. This simple probability monad has been a great fit for the stochastic optimization problems we’re facing at Target, where different solution methods require random sampling (simulation-based optimization) or the entire distribution (policy iteration, linear programming). As a bonus, this’ll give you a brief primer on supply chain optimization. I’ll also talk about the very real performance shortcomings of this approach—which we’ve mostly managed to dodge at Target. Finally, I’ll introduce some recent research that defines a free-monad based distribution type that can take advantage of cutting-edge research on probabilistic programming. This approach lets us work with continuous distributions and Bayesian conditioning, and lets us deploy modern sampling and probabilistic inference algorithms with performance comparable to dedicated probabilistic programming languages like Anglican. This talk primarily draws on two papers: - ‘Probabilistic Functional Programming in Haskell’ by Martin Erwig and Steve Kollmansberger which describes the discrete probability monad - ‘Practical Probabilistic Programming with Monads’ by Adam Scibior, Zoubin Ghahramani and Andrew D. Gordon which describes how to extend the basic monadic approach with modern probabilistic programming techniques

Why it's here

1 person recommends this

What people say. Recommended as an excellent explanation of the probability monad and its practical applications.

Moments people linked to

u/mightybytein r/haskell • Recommends

Compose Conference - The Probability Monad

u/rampionin r/haskell • Mentions

On “Compose Conference - The Probability Monad”

typo on the slide at 17:07 (slide 21)- you've got `uniform xs = Dist (zip xs 1..)` but it should be `uniform xs = Dist (zip xs (repeat 1))`
1View on Reddit

u/fintanhin r/haskell • Mentions

On “[FEATURE] Binding multiple variables at once?”

For the first thing, it sounds similar to a ZipList where \`pure\` will give you a repeated value and then you could zip with a list of your constructors. I think there's similar ideas from Tikhon Jelvis [video Second thing doesn't seem major to me :)