-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Computing unconditional probabilities at a children node #147
Comments
Hello Bernardo. I believe that what you are looking for is the For example:
will give you the posterior distribution over As such, for your example, just run |
Hello Tim, thanks for the reply. I believe you are right, this is the function I need. However, I tried the command you suggested but it did not work. I went back to the tutorial and I understood the inference example. Maybe it is because I am using StaticCPD? I don't know.
I got this error: Best, |
Ah, yes, I think the inference methods require using a DiscreteBayesNet - otherwise users could have continuous variables, non-integer variables, etc. Here is the equivalent approach:
which tells us that P(:node4 = true) is 0.8 |
Awesome Tim, thanks for saving me again. |
Hello,
I need to compute probabilities in a BN and for a bn = BayesNet() with 4 nodes (nodes 1 2 and 3 are parents of node 4, all Bernoulli r.v.) I was able to
Compute the joint distribution:
pdf(bn, :node1=>true, :node2=>true, :node3=>true, :node4=>true)
Compute the conditional distribution at node 4:
cpd4(:node1=>false, :node2=>true, :node3=>true)
What I could not do is to compute
Prob(:node4 = false)
I know that mathematically the answer is
\sum_{s\in S_4} Prob(s) Prob (node 4 = false | s) (1)
where S_4 is the set of states associated with node 4 (8 of them, TTT, TTF, TFF, etc).
Is there an automatic way of computing that without actually constructing equation (1)?
Thanks in advance!
Bernardo
The text was updated successfully, but these errors were encountered: