COM.hugin.HAPI
Class ContinuousChanceNode

java.lang.Object
  extended byCOM.hugin.HAPI.Node
      extended byCOM.hugin.HAPI.ContinuousChanceNode

public class ContinuousChanceNode
extends Node

Represents continuous chance nodes with (conditional) Gaussian distributions. Continuous chance nodes are also sometimes called CG nodes (CG for conditional Gaussian).


Constructor Summary
ContinuousChanceNode(NetworkModel initBelongsTo)
          Constructs a new continuous chance node.
 
Method Summary
 boolean caseIsSet(int c)
          Returns 'true' if a value has been set for this ContinuousChanceNode in case 'c'; otherwise, returns 'false'.
 void delete()
          Deletes this ContinuousChanceNode.
 void enterValue(double value)
          Enters evidence (observation of the value) for this ContinuousChanceNode.
 double getAlpha(int i)
          Returns the alpha component of the CG distribution of this ContinuousChanceNode given the discrete parent configuration corresponding to 'i'.
 double getBeta(ContinuousChanceNode parent, int i)
          Returns the beta component of the CG distribution of this ContinuousChanceNode given a continuous parent and the discrete parent configuration corresponding to 'i'.
 double getCaseValue(int c)
          Returns the value set for this ContinuousChanceNode in case 'c'.
 NetworkModel.Category getCategory()
          Returns the Category for this ContinuousChanceNode.
 Table getDistribution()
          Returns the distribution for this continuous node.
 double getEnteredValue()
          Returns the evidence (value) entered for this ContinuousChanceNode.
 double getGamma(int i)
          Returns the gamma component of the CG distribution of this ContinuousChanceNode given the discrete parent configuration corresponding to 'i'.
 NetworkModel.Kind getKind()
          Returns the Kind for this ContinuousChanceNode.
 double getMean()
          Returns the mean of the marginal distribution of this ContinuousChanceNode.
 double getPropagatedValue()
          Retrieves the value that has been propagated for this ContinuousChanceNode.
 double getSampledValue()
          Returns the value of this ContinuousChanceNode for the configuration generated by the most recent call to Domain.simulate().
 Table getTable()
          Returns the table associated with this node.
 double getVariance()
          Returns the variance of the marginal distribution of this ContinuousChanceNode.
 void retractFindings()
          Retracts the evidence (value) entered for this ContinuousChanceNode.
 void setAlpha(double alpha, int i)
          Sets the alpha component of the CG distribution of this ContinuousChanceNode given the discrete parent configuration corresponding to 'i'.
 void setBeta(double beta, ContinuousChanceNode parent, int i)
          Sets the beta component of the CG distribution of this ContinuousChanceNode given a continuous parent and the discrete parent configuration corresponding to 'i'.
 void setCaseValue(int c, double value)
          Sets the value of this ContinuousChanceNode to 'value' in case 'c'.
 void setGamma(double gamma, int i)
          Sets the gamma component of the CG distribution of this ContinuousChanceNode given the discrete parent configuration corresponding to 'i'.
 void unSetCase(int c)
          Specifies that the value of this ContinuousChanceNode is 'unknown' for case 'c'.
 
Methods inherited from class COM.hugin.HAPI.Node
addParent, addToInputs, addToOutputs, evidenceIsEntered, evidenceIsPropagated, evidenceToPropagate, getAttribute, getAttributes, getChildren, getDomain, getEdgeConstraint, getHome, getHomeClass, getHomeDomain, getInstance, getJunctionTree, getLabel, getMaster, getModel, getName, getParents, getPosition, getSource, getUserData, likelihoodIsEntered, likelihoodIsPropagated, removeFromInputs, removeFromOutputs, removeParent, reverseEdge, setAttribute, setAttributes, setEdgeConstraint, setLabel, setName, setPosition, setUserData, switchParent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContinuousChanceNode

public ContinuousChanceNode(NetworkModel initBelongsTo)
                     throws ExceptionHugin
Constructs a new continuous chance node.

Parameters:
initBelongsTo - the NetworkModel (i.e., Class or Domain) to which the new node should belong.
Method Detail

getTable

public Table getTable()
               throws ExceptionHugin
Returns the table associated with this node.

Returns:
A Table.
Throws:
ExceptionHugin

getDistribution

public Table getDistribution()
                      throws ExceptionHugin
Returns the distribution for this continuous node. The distribution for a continuous chance node is in general a mixture of several Gaussian distributions. This method actually computes a joint distribution of this CG node and a set of discrete nodes. These discrete nodes are chosen such that the computed marginal is a strong marginal, but it is not necessarily minimal.

Returns:
A Table holding a strong marginal of this node and a set of discrete nodes.
Throws:
ExceptionHugin

getMean

public double getMean()
               throws ExceptionHugin
Returns the mean of the marginal distribution of this ContinuousChanceNode.

Returns:
A real number (double precision) expressing the mean.
Throws:
ExceptionHugin

getVariance

public double getVariance()
                   throws ExceptionHugin
Returns the variance of the marginal distribution of this ContinuousChanceNode.

Returns:
A real number (double precision) expressing the variance.
Throws:
ExceptionHugin

getAlpha

public double getAlpha(int i)
                throws ExceptionHugin
Returns the alpha component of the CG distribution of this ContinuousChanceNode given the discrete parent configuration corresponding to 'i'.

Parameters:
i - the index of a discrete parent configuration.
Returns:
the alpha component.
Throws:
ExceptionHugin

getBeta

public double getBeta(ContinuousChanceNode parent,
                      int i)
               throws ExceptionHugin
Returns the beta component of the CG distribution of this ContinuousChanceNode given a continuous parent and the discrete parent configuration corresponding to 'i'.

Parameters:
parent - a ContinuousChanceNode parent of this ContinuousChanceNode.
i - the index of a discrete parent configuration.
Returns:
the beta component.
Throws:
ExceptionHugin

getGamma

public double getGamma(int i)
                throws ExceptionHugin
Returns the gamma component of the CG distribution of this ContinuousChanceNode given the discrete parent configuration corresponding to 'i'.

Parameters:
i - the index of a discrete parent configuration.
Returns:
the gamma component.
Throws:
ExceptionHugin

setAlpha

public void setAlpha(double alpha,
                     int i)
              throws ExceptionHugin
Sets the alpha component of the CG distribution of this ContinuousChanceNode given the discrete parent configuration corresponding to 'i'.

Parameters:
alpha - the value of the alpha component.
i - the index of a discrete parent configuration.
Throws:
ExceptionHugin

setBeta

public void setBeta(double beta,
                    ContinuousChanceNode parent,
                    int i)
             throws ExceptionHugin
Sets the beta component of the CG distribution of this ContinuousChanceNode given a continuous parent and the discrete parent configuration corresponding to 'i'.

Parameters:
beta - the value of the beta component.
parent - a ContinuousChanceNode parent of this ContinuousChanceNode.
i - the index of a discrete parent configuration.
Throws:
ExceptionHugin

setGamma

public void setGamma(double gamma,
                     int i)
              throws ExceptionHugin
Sets the gamma component of the CG distribution of this ContinuousChanceNode given the discrete parent configuration corresponding to 'i'.

Parameters:
gamma - the value of the gamma component.
i - the index of a discrete parent configuration.
Throws:
ExceptionHugin

enterValue

public void enterValue(double value)
                throws ExceptionHugin
Enters evidence (observation of the value) for this ContinuousChanceNode.

Parameters:
value - a real number representing the observation.
Throws:
ExceptionHugin

getEnteredValue

public double getEnteredValue()
                       throws ExceptionHugin
Returns the evidence (value) entered for this ContinuousChanceNode. If no value has been entered, an ExceptionHugin is thrown.

Returns:
A real number (double precision) expressing the value entered.
Throws:
ExceptionHugin

retractFindings

public void retractFindings()
                     throws ExceptionHugin
Retracts the evidence (value) entered for this ContinuousChanceNode.

Throws:
ExceptionHugin

getPropagatedValue

public double getPropagatedValue()
                          throws ExceptionHugin
Retrieves the value that has been propagated for this ContinuousChanceNode. That is, the value incorporated in the current JunctionTree potentials as the state of this node.

Returns:
A real number (double precision) expressing the propagated value.
Throws:
ExceptionHugin

getCategory

public NetworkModel.Category getCategory()
                                  throws ExceptionObjectNotAlive
Returns the Category for this ContinuousChanceNode.

Overrides:
getCategory in class Node
Returns:
NetworkModel.H_CATEGORY_CHANCE.
Throws:
ExceptionObjectNotAlive

getKind

public NetworkModel.Kind getKind()
                          throws ExceptionObjectNotAlive
Returns the Kind for this ContinuousChanceNode.

Overrides:
getKind in class Node
Returns:
NetworkModel.H_KIND_CONTINUOUS.
Throws:
ExceptionObjectNotAlive

setCaseValue

public void setCaseValue(int c,
                         double value)
                  throws ExceptionHugin
Sets the value of this ContinuousChanceNode to 'value' in case 'c'.

Parameters:
c - the case index represented as an integer.
value - the value represented as a real number.
Throws:
ExceptionHugin

unSetCase

public void unSetCase(int c)
               throws ExceptionHugin
Specifies that the value of this ContinuousChanceNode is 'unknown' for case 'c'.

Parameters:
c - the case index represented as an integer.
Throws:
ExceptionHugin

caseIsSet

public boolean caseIsSet(int c)
                  throws ExceptionHugin
Returns 'true' if a value has been set for this ContinuousChanceNode in case 'c'; otherwise, returns 'false'.

Parameters:
c - the case index represented as an integer.
Returns:
A boolean.
Throws:
ExceptionHugin

getCaseValue

public double getCaseValue(int c)
                    throws ExceptionHugin
Returns the value set for this ContinuousChanceNode in case 'c'.

Throws:
ExceptionHugin

getSampledValue

public double getSampledValue()
                       throws ExceptionHugin
Returns the value of this ContinuousChanceNode for the configuration generated by the most recent call to Domain.simulate().

Returns:
A double - the value sampled for this during the last invocation of simulate() on the domain of this.
Throws:
ExceptionHugin

delete

public void delete()
            throws ExceptionHugin
Deletes this ContinuousChanceNode.

Overrides:
delete in class Node
Throws:
ExceptionHugin