Issue with calculating utilities with decision nodes

The engine.
Post Reply
andrew_ling
Posts: 9
Joined: Wed May 14, 2008 11:16 pm

Issue with calculating utilities with decision nodes

Post by andrew_ling »

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
Attachments
Crop Yield Example.zip
Please change the extension of the file to .dne after you download it.
(1.94 KiB) Downloaded 653 times
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: Issue with calculating utilities with decision nodes

Post by shooltz[BayesFusion] »

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?
andrew_ling
Posts: 9
Joined: Wed May 14, 2008 11:16 pm

Post by andrew_ling »

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)
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Post by shooltz[BayesFusion] »

andrew_ling wrote:2. Set the evidence if this is required: net.SetEvidence(nodeID, optionID)
Without evidence, I'm getting 1200/1000 as value of 'Fertiliser' node from simple program. To check the values with evidence, I'll definitely need your choice of arguments for SetEvidence call(s).
andrew_ling
Posts: 9
Joined: Wed May 14, 2008 11:16 pm

Post by andrew_ling »

I have found the fix to my issue. I fixed it by using the latest version of Smile.
Post Reply