VB.NET Tutorial 3: Building an Influence Diagram
From DSL
In this tutorial we will extend our Bayesian network into an influence diagram. Suppose that our venture capitalist invests $5,000 in the venture. She knows that if the venture is successful, she will earn an additional $10,000 on it. If it is not successful, she will lose her entire investment of $5,000, and if she does not invest, her gain will be $500 from a risk-free investment in a bank. We will assume that our capitalist is interested only in financial gain. In case other factors play a role, such as intangible values or non-linearity in the intrinsic value of money, they can be captured by a measure known as utility. We will limit ourselves to mentioning that jSMILE supports expected utility calculation, leaving it to the user to learn how to measure and represent utility.
We will extend our Bayesian network into an influence diagram by adding to it a decision node and a utility node. The decision will represent the choices of investing or not investing and the utility node will measure the financial gain. We start with the Bayesian network constructed in Tutorial 1.
Dim net As new Network()
net.ReadFile("tutorial_a.xdsl")
We create decision node Invest. The type of the node will be List which represents a discrete decision node (see Network class definition for details regarding node types).
net.AddNode(Network.NodeType.List, "Invest")
We now set all the possible choices for this decision in the same way we did for the Success and Forecast nodes in the tutorial 2.
net.SetOutcomeId("Invest", 0, "Invest")
net.SetOutcomeId("Invest", 1, "DoNotInvest");
Now we create the utility node. The type used is Table.
net.AddNode(Network.NodeType.Table, "Gain")
We now have to create some arcs. From the problem description, we can see that the final financial gain will depend on our decision whether to invest or not and also on whether the company actually succeeds or not. Therefore, we add two arcs.
net.AddArc("Invest", "Gain")
net.AddArc("Success", "Gain")
Once the structure of a diagram is complete let us fill in the numbers. The decision node is perfectly defined by its different options. The value node, on the other hand, needs to be specified in numerical terms. From background information we can tell that the utilities are the following:
U("Invest" = Invest, "Success" = Success) = 10000
U("Invest" = Invest, "Success" = Failure) = -5000
U("Invest" = DoNotInvest, "Success" = Success) = 500
U("Invest" = DoNotInvest, "Success" = Failure) = 500
We know that the size of the definition of this node is 4 (2x2x1).
Dim aGainDef() As Double = {10000, -5000, 500, 500}
net.SetNodeDefinition("Gain", aGainDef)
Now we have a complete influence diagram. Let us save it for future use.
net.WriteFile("tutorial_b.xdsl")
