Are there any examples for intercausal reasoning using pymc3?
For example, given this graph (or any for that matter, this is just first one coming into mind).
We can model it, have some priors, observe for example WetGrass, then we can calculate (sample) posteriors.(lets assume this is learning, model training)
But, how would you compute P(Cloudy=True | Sprinkler=True)=? and enable some interface to user.
Any continues example, not only discrete or even better combined would be great.
Following the definition of conditional probability, you have:
P(A|B) = P(A and B)/P(B)
P(Cloudy=True | Sprinkler=True) = P(Cloudy=True and Sprinkler=True) / P(Sprinkler=True) = 0.1 / (0.1+0.5) = 1/6
would you mind giving a code example for this problem?
i don’t think it’s that trivial to model this in pymc3…i mean, what if you have conditional probability density function instead of table, and also a few more variables… integrating (or summing) denominator for marginalising is not an option i’d say…
Hmm it depends on what your question is and how much information you have at each node - the above example could be rewrite into a mixture model which capable of handling continuous densities. But it might not be the ideal solution if you have other kind of Bayesian DAG.