I want to observe several variables and update_belifes() and then check the posterior probability of the outcome variable of interest.
I am write code as follows
Code: Select all
```
net.set_evidence(node_name, val)
net.update_beliefs()
```The net is a parameterized network using EM algorithm. The graph statistics is as follows:
Code: Select all
```
=== Bayesian Network Graph Statistics for SMILE ===
Is Directed Acyclic Graph (DAG)?: True
Number of Nodes (Variables): 1320
Number of Edges (Direct Dependencies): 3752
Max Parent Count (Max In-Degree): 14
Weakly Connected Components: 28 (Inference can be segmented if > 1)
Moral Edges Added (Co-parent marriages): 5311
Approximate Treewidth (of moral graph): 370
```I have the following questions:
1. If I set_evidence() for one variable, does `net.update_beliefs()` need to calculate probability information for all nodes in the graph?
2. In SMILE wrappers document, I saw the following description when Network.updateBeliefs has problem:
Code: Select all
```
Network.updateBeliefs throws an exception with error code -42 if the temporary data structures required to
complete the inference take too much memory. In such case, or if the inference takes too long, consider taking
advantage of SMILE's relevance reasoning layer. Relevance reasoning runs as a preprocessing step, which can
lessen the complexity of later stages of inference algorithms. Relevance reasoning takes the target node set into
account, therefore, to reduce the workload you should reduce the number of nodes set as targets if possible. Note
that by default all nodes are targets (this is the case when no nodes were marked as such). If your network has
1,000 nodes and you only need the probabilities of 20 nodes, by all means call Network.setTarget on them.
```I have a outcome variable named "O" in a large network, I want to observe all direct causes and direct effect of this outcome (i.e. all parents and successors of outcome variable "O").
2.1 Could you please write some sample code for to set targets?
2.2 In my case, should I "set target" for the following nodes: 1) outcome variable "O", 2) all parents and all successors of "O"?
2.3 What is the difference between following two cases: 1) observe on the original network (without "set target") and 2) "set target" on the network and then do observation?
Thanks.