9.1
7 Queries and learning
7.1 Bayesian learning
Learning is the process of incorporating new information into your set of existing beliefs. Bayesian reasoning gives a beautiful
> (define param (if (flip 1/2) 0.1 0.9)) > (observe! (equal? (flip param) #t)) > (observe! (equal? (flip param) #f)) > (observe! (equal? (flip param) #f)) > (observe! (equal? (flip param) #f)) > (observe! (equal? (flip param) #f)) > param
┌─────┬─────────────────────┐
│Value│Probability │
├─────┼─────────────────────┤
│0.1 │0.9986301369863013 │
│0.9 │0.0013698630136986284│
└─────┴─────────────────────┘
Inference