I seem to having an issue with the network attached to this document. I do not seem to be able to get correct utility values (they are all 0s, Yes should be 1200 and No should be 1000) for the decision node in this network. I am using the PolicyEvaluation influence diagram algorithm type and Lauritzen bayeisian algorithm type.
How would I go about retrieving the utilities for the decision node?
Andrew
Issue with calculating utilities with decision nodes
-
- Posts: 9
- Joined: Wed May 14, 2008 11:16 pm
Issue with calculating utilities with decision nodes
- Attachments
-
- Crop Yield Example.zip
- Please change the extension of the file to .dne after you download it.
- (1.94 KiB) Downloaded 653 times
-
- Site Admin
- Posts: 1419
- Joined: Mon Nov 26, 2007 5:51 pm
Re: Issue with calculating utilities with decision nodes
After loading the model in GeNIe and performing inference, I'm getting 1200 for Yes and 1000 for No. Since you're posting in the SMILE forum, I assume you have some piece of code which loads/calls UpdateBeliefs, then retrieves the value of decision node. Can you post it here?
-
- Posts: 9
- Joined: Wed May 14, 2008 11:16 pm
To retrieve the value of the decision node I am using the following code:
1. Clear the evidence: net.ClearAllEvidence()
2. Set the evidence if this is required: net.SetEvidence(nodeID, optionID)
3. Update the beliefs in the network: net.UpdateBeliefs()
4. Get the node value: net.GetNodeValue(nodeID)
To add nodes and links to the network I am using the following code:
1. net.AddNode(NodeType, nodeID) where NodeType is one of the following:
a. NodeType.Cpt for all nature nodes
b. NodeType.List for all decision nodes
c. NodeType.Table for all utility nodes
2. Set the position, background colour and description for the node using net.SetNodePosition, net.SetNodeDescription and net.SetNodeBgColor
3. Add outcomes to the nodes using net.AddOutcome(nodeID, optionID)
4. Add links to the nodes using net.AddArc(parentNodeID, childNodeID)
5. Set the probabilities for the nodes using net.SetNodeDefinition(nodeID, utilities)
1. Clear the evidence: net.ClearAllEvidence()
2. Set the evidence if this is required: net.SetEvidence(nodeID, optionID)
3. Update the beliefs in the network: net.UpdateBeliefs()
4. Get the node value: net.GetNodeValue(nodeID)
To add nodes and links to the network I am using the following code:
1. net.AddNode(NodeType, nodeID) where NodeType is one of the following:
a. NodeType.Cpt for all nature nodes
b. NodeType.List for all decision nodes
c. NodeType.Table for all utility nodes
2. Set the position, background colour and description for the node using net.SetNodePosition, net.SetNodeDescription and net.SetNodeBgColor
3. Add outcomes to the nodes using net.AddOutcome(nodeID, optionID)
4. Add links to the nodes using net.AddArc(parentNodeID, childNodeID)
5. Set the probabilities for the nodes using net.SetNodeDefinition(nodeID, utilities)
-
- Site Admin
- Posts: 1419
- Joined: Mon Nov 26, 2007 5:51 pm
-
- Posts: 9
- Joined: Wed May 14, 2008 11:16 pm