Saturday, October 23, 2021

Bake It

 Pomegranate isreally wonderful. One can build up a model

very simply. Below, the train model:



Once all ia done; bake()

One is then free to run different types of queries. The first, inference, wants to
know if we are going to make the appointment, given that the train is delayed.
Computer gives back the odds on that, pure and simple. Note that the only parent
node to making the appointment is the train.


The likelyhood code below makes a different kind of enquiry. It wants to know if I will
make it on a day where the train is on time (0.9 prob) but whether I will exhibit this
virtuous behaviour on a no rain day with no maintenance. The probability of all that is
a paltry 0.3402 !!


A third type of query possibility is sampling. The computer makes multiple runs on 
conditions.




We are interested about making the appointmnt given a delayed train (proba 0.6)
but we are catching that the train maybe delayed as a function of rain and maintenance 
(and indeed mainteance itself is inversely affected by rain). 

                                                              *     *     *



No comments: