Is there a way to solve for statistical quantities analytically/symbolically in Mathematica?
example 1:
Lets say that I want to do a calculation that requires Bayes theorem.
I know p(a), p(b) and p(a | b). I want to calculate p(b | a).
Now, for this simple example, I know the solution, so I could write the relationship myself, but what about more complicated examples? Surely Mathematica is able to solve probability problems like it can solve algebraic ones? I want to stay away from simulation. I want Mathematica to do the five pages of math that I normally do on paper. Can Mathematica do this for me?
I'd like to type something like
Solve[p(a) == a1 && p(b) == a2 && p(a|b) == a3, p(b|a)]
and get
p(b|a) -> (a3*a2)/a1
example 2:
I want to use the law of total probability:
I know p(a|b)
, p(a|!b)
, and p(b)
and I want to calculate p(a)
.
I'd like to type something like
Solve[p(a|b) == a1 && p(a|!b) == a2 && p(b) == a3, p(a)]
and get
p(a) -> a1*a3 + a2*(1-a3)