com.cra.bnet.engine
Class DecisionAnalysisTools

java.lang.Object
  |
  +--com.cra.bnet.engine.DecisionAnalysisTools

public final class DecisionAnalysisTools
extends Object

Decision analysis utility class.


Method Summary
static Map getMutualInformation(BayesianNetwork network, DiscreteNode queryNode)
          Returns an unmodifiable map containing the mutual information between the specified query variable and every variable in the specified Bayesian network (including the query variable itself).
static Map getMutualInformation(BayesianNetwork network, DiscreteNode queryNode, double threshold)
          Returns an unmodifiable map containing the mutual information between the specified query variable and every variable in the specified Bayesian network (including the query variable itself).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMutualInformation

public static Map getMutualInformation(BayesianNetwork network,
                                       DiscreteNode queryNode)
Returns an unmodifiable map containing the mutual information between the specified query variable and every variable in the specified Bayesian network (including the query variable itself). This method returns:
 getMutualInformation(network, queryVariableId, 0.0);
 

Parameters:
network - Bayesian network.
queryNode - query node.
Returns:
mutual information between query variable and all other nodes in the Bayesian network.

getMutualInformation

public static Map getMutualInformation(BayesianNetwork network,
                                       DiscreteNode queryNode,
                                       double threshold)
Returns an unmodifiable map containing the mutual information between the specified query variable and every variable in the specified Bayesian network (including the query variable itself). Entries in the returned map are of type (String, Double) where the String objects are the variable names and Double objects are the mutual information values.

Values less than or equal to the specified threshold are not included in the returned map.

Mutual information between a query variable Q and a findings variable F is described in Pearl pg321-323, and is defined as:

  MI(Q,F) = SUMq SUMf P(q,f|e) * log(P(q,f|e) / (P(q|e) * P(f|e)))

  MI(Q,Q) = SUMq P(q|e) * log(P(q|e))
  

Mutual information gives the expected reduction in entropy of the query variable Q due to a finding on the findings variable F. Thus, mutual information gives a measure of how sensitive variable Q is to evidence on variable F. Note also that mutual information is symmetric between nodes, so MI(Q,F) = MI(F,Q).

The log function in the above equations has base 2; this stems from the entropy equation in information theory where log2(N) gives the number of bits required to represent N different messages.

If the specified Bayesian network is disconnected, this method will return an empty map.

Parameters:
network - Bayesian network.
queryNode - query node.
threshold - the threshold for filtering values.
Returns:
mutual information between query variable and all other nodes in the Bayesian network.