jBNC Toolbox

jbnc.graphs
Class BNCInference

java.lang.Object
  extended byjbnc.graphs.BNCInference

public class BNCInference
extends java.lang.Object

Efficient calculation of the joint probability distribution and and conditional probability of the class variable given values of all attributes. Assumes that all nodes are instantiated.

Since:
June 1, 1999
Author:
Jarek Sacha

Field Summary
protected  double[] condClassProb
           
protected  int nbClasses
           
protected  int nbVars
           
protected  double[][] probFuncs
          Probability function values for each of the network nodes.
protected  int[][] radix
          Used to calculate index within the probFunction.
protected  int[][] variables
          Variables for each of the probability function.
 
Constructor Summary
BNCInference(BayesianNetworks.BayesNet net)
           
 
Method Summary
 double[] getCondClassProb(int[] aCase)
          Return values of the class node conditional probability given instantiation of attribute variables.
 double getJointProb(int[] aCase)
          Return the value of the joint probability for the instantiation of the variables given by parameter 'vars'.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nbVars

protected int nbVars

nbClasses

protected int nbClasses

probFuncs

protected double[][] probFuncs
Probability function values for each of the network nodes.


variables

protected int[][] variables
Variables for each of the probability function.


radix

protected int[][] radix
Used to calculate index within the probFunction.


condClassProb

protected double[] condClassProb
Constructor Detail

BNCInference

public BNCInference(BayesianNetworks.BayesNet net)
             throws java.lang.Exception
Parameters:
net - Description of Parameter
Throws:
java.lang.Exception - Description of Exception
Method Detail

getJointProb

public double getJointProb(int[] aCase)
                    throws java.lang.Exception
Return the value of the joint probability for the instantiation of the variables given by parameter 'vars'.

Parameters:
aCase - Values for each of the varaibles in the network. The last variable is class variable.
Returns:
The JointProb value
Throws:
java.lang.Exception - when size of array 'aCase' is different then expected.

getCondClassProb

public double[] getCondClassProb(int[] aCase)
                          throws java.lang.Exception
Return values of the class node conditional probability given instantiation of attribute variables.

Parameters:
aCase - Values for each of the varaibles in the network. The last variable is class variable. Its value is ignored.
Returns:
The CondClassProb value
Throws:
java.lang.Exception - when size of array 'aCase' is different then expected.

SourceForge.net Logo