Issue with calculating utilities with decision nodes

The engine

Issue with calculating utilities with decision nodes

Postby andrew_ling » Fri Sep 19, 2008 7:50 am

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

Re: Issue with calculating utilities with decision nodes

Postby shooltz » Fri Sep 19, 2008 7:43 pm

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?
shooltz
Site Admin
 
Posts: 812
Joined: Mon Nov 26, 2007 5:51 pm

Postby andrew_ling » Sat Sep 20, 2008 12:44 am

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

Postby shooltz » Mon Sep 22, 2008 9:52 am

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).
shooltz
Site Admin
 
Posts: 812
Joined: Mon Nov 26, 2007 5:51 pm

Postby andrew_ling » Mon Sep 22, 2008 11:15 am

I have found the fix to my issue. I fixed it by using the latest version of Smile.
andrew_ling
 
Posts: 9
Joined: Wed May 14, 2008 11:16 pm


Return to SMILE

Who is online

Users browsing this forum: Bing [Bot] and 0 guests