Examples of influence diagrams
An influence diagram is an extension of a Bayesian network with can be used to solve some decision problems. In an influence diagram, there are two new kind of nodes : decision nodes and utility nodes.
Solving an influence diagram means determining the strategies for each decision variable that will maximize the average utility.
There must be an ordering of the decision variables : a path through all the decisions.
A decision variable can depend on other past decisions and probabilistic nodes. In the later case, the variable of the probabilistic node is assumed to be observed before the decision is taken. So, the decision is only trying to maximize the average utility based on what has not been observed (the future and some past probabilistic variables).
A probabilistic node can depend on other probabilistic nodes (like in a Bayesian network) and decision nodes.
An utility is a leaf of the graph.
Building an influence diagram is done like for a Bayesian network : by using the right monad.
import Bayes.InfluenceDiagram studentSimple = snd .
Then, you create the different nodes of the graph:
t:: E) uc <-
utilityNode"UC" ub <-
utilityNode"UB" i <-
t:: I) pr <-
The types used above are:
data E = Dont | Do deriving(Eq,Enum,Bounded) data I = Low | Average | High deriving(Eq,Enum,Bounded)
Then, you need to define the dependencies and the numerical values. For probabilistic nodes, it is done like for Bayesian network:
cpt pr [
de] ~~ [1-0.0000001,1 - 0.001,0.0000001, 0.001] cpt i [
de] ~~ [0.2,0.1,0.01,0.01,0.6,0.5,0.04,0.04,0.2,0.4,0.95,0.95]
For decision nodes, the method is similar but with two differences : The first decision may depend on nothing (just on the assumed future). And there are no values to define for a decision variable since the goal of the influence diagram is to compute them.
For the utility nodes, it is similar to probabilistic nodes. You define the dependencies and the numerical values:
Once the influence diagram is defined, you can solve it:
The result of this function is the solution : the decision strategies. You may want to display also the original graph to see to which node are corresponding the vertex numbers.
You can transform a solved influence diagram into a policy network : a Bayesian network where decision variables have been replaced with probabilistic variables where the conditional probability table is containing 1 for a choice of variables corresponding to the decision and 0 otherwise.
let l =
solveInfluenceDiagramstudent g =
policyNetworkl student print g
Variables for some networks
Tests for the networks
Solve the influences diagrams for the both student network. Also displays each network