public class MarginCalculator extends java.lang.Object implements java.io.Serializable, RevisionHandler
Modifier and Type | Class and Description |
---|---|
class |
MarginCalculator.JunctionTreeNode |
class |
MarginCalculator.JunctionTreeSeparator |
Modifier and Type | Field and Description |
---|---|
MarginCalculator.JunctionTreeNode |
m_root |
Constructor and Description |
---|
MarginCalculator() |
Modifier and Type | Method and Description |
---|---|
void |
calcFullMargins(BayesNet bayesNet) |
void |
calcMargins(BayesNet bayesNet)
Calc marginal distributions of nodes in Bayesian network
Note that a connected network is assumed.
|
boolean[][] |
fillIn(int[] order,
boolean[][] bAdjacencyMatrix)
Apply Tarjan and Yannakakis (1984) fill in algorithm for graph
triangulation.
|
double[] |
getMargin(int iNode) |
int |
getNode(java.lang.String sNodeName) |
java.lang.String |
getRevision()
Returns the revision string.
|
static void |
main(java.lang.String[] args) |
boolean[][] |
moralize(BayesNet bayesNet)
moralize DAG and calculate
adjacency matrix representation for a Bayes Network, effecively
converting the directed acyclic graph to an undirected graph.
|
void |
process(boolean[][] bAdjacencyMatrix,
BayesNet bayesNet) |
void |
setEvidence(int nNode,
int iValue) |
java.lang.String |
toString() |
java.lang.String |
toXMLBIF03() |
public MarginCalculator.JunctionTreeNode m_root
public int getNode(java.lang.String sNodeName)
public java.lang.String toXMLBIF03()
public void calcMargins(BayesNet bayesNet) throws java.lang.Exception
bayesNet
- java.lang.Exception
public void calcFullMargins(BayesNet bayesNet) throws java.lang.Exception
java.lang.Exception
public void process(boolean[][] bAdjacencyMatrix, BayesNet bayesNet) throws java.lang.Exception
java.lang.Exception
public boolean[][] moralize(BayesNet bayesNet)
bayesNet:
- Bayes Network to processpublic boolean[][] fillIn(int[] order, boolean[][] bAdjacencyMatrix)
order:
- node orderingbAdjacencyMatrix:
- boolean matrix representing the graphpublic void setEvidence(int nNode, int iValue) throws java.lang.Exception
java.lang.Exception
public java.lang.String toString()
toString
in class java.lang.Object
public double[] getMargin(int iNode)
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
public static void main(java.lang.String[] args)