I'm not sure if there is a gap in my stats knowledge or Mathematica knowledge but it's time to ask for help.
I have the following system I am trying to calculate the condition probability of getting to stage 3.
Finding the joint distribution is straightforward:
Block[{A, B, C, p},
{A, B, C} = {0.2528674027226927, 0.506570580754557, 0.705439330543933};
p = NProbability[
c == 1 && b == 1 &&
a == 1 , {a \[Distributed] BernoulliDistribution[A],
b \[Distributed] BernoulliDistribution[B],
c \[Distributed] BernoulliDistribution[C]}];
p
]
(* results 0.0903634 *)
However, to me this network needs to be modelled conditionally since how many draws make it to stage 3 depends on passing stage 1 and 2. However, I've tried a couple of different ways and my answers don't seem reasonable when compared to the initial values. I was expecting a value under ~0.25. Does anyone notice anything wrong with me code?
Block[{results, prob, A, B, C},
{A, B, C} = {0.2528674027226927, 0.506570580754557, 0.705439330543933};
prob = Probability[
b == 1 \[Conditioned]
a == 1, {a \[Distributed] BernoulliDistribution[A],
b \[Distributed] BernoulliDistribution[B]}];
results =
Probability[c == 0 \[Conditioned] prob,
c \[Distributed] BernoulliDistribution[C]];
results
]
(* returns \[Piecewise]
0.294561 0.506571
0 True. *)