I was porting the example of a Simple Bayesian Network via Monte Carlo Markov Chain from PyMC2
to PyMC3
and it works.
The result can be found in the following gist on GitHub in the file pymc3_rain_sprinkler_grass_simple_bayesian_network.py.
I wanted to extend the original example by providing evidence, e.g. that the grass is wet and then let PyMC3
give me the answer for questions like "given grass is wet, what is the probability that it has rained?".
It seems that the resulting trace is "constant", e.g. there is no element of randomness in it any more. Have a look at pymc3_rain_sprinkler_grass_simple_bayesian_network_with_evidence.py
in the gist and execute the df.drop_duplicates()
to see what I mean.
What am I doing wrong?