I’m trying to understand whether pymc3 is able to perform forward in addition to backwards reasoning through its inference engine. I’ll explain with a very simple example.
Imagine the following model; two coins independently distributed with Bernoulli distribution and a bias of 0.5
for both of them. Now create a random variable which is true if both the two coins are heads.
I.e.
x ~ Bernoulli(0.5)
y ~ Bernoulli(0.5)
z = x&y
So z
is true when both x
and y
are True
, and False
otherwise.
My questions are:
- Does pymc3 support inference of the distribution of the random variable
z
(i.e. should become Bern( 0.25)). - I could now set
z
to be observed toTrue
. I’d then like to infer the new distribution forx
, say (i.e. Bern(0.33)). - Set
x
to be observed toTrue
. I’d then like to infer the distribution forz
(i.e. Bern(0.5)).
I realise that due to the implementation of the inference via MCMC this might not be possible, especially as the first one involves no likelihood which could easily be done by belief propagation but I imagine not so in MCMC.
Thanks!