Package edu.cmu.tetrad.bayes
Interface BayesUpdater
- All Superinterfaces:
- Serializable,- TetradSerializable
- All Known Subinterfaces:
- ManipulatingBayesUpdater
- All Known Implementing Classes:
- ApproximateUpdater,- CptInvariantUpdater,- Identifiability,- JunctionTreeUpdater,- RowSummingExactUpdater
Interface for a discrete Bayes updating algorithm. The main task of such and algorithm is to calculate P(X = x' |
 evidence), where evidence takes the form of a Proposition over the variables in the Bayes net, possibly with
 additional information about which variables in the Bayes net have been manipulated. Some updaters may be able to
 calculate joint marginals as well--that is, P(AND_i{Xi = xi'} | evidence). Also, not all updaters can take
 manipulation information into account. See implementations for details.)
- Version:
- $Id: $Id
- Author:
- josephramsey
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptiondouble[]calculatePriorMarginals(int nodeIndex) Calculates the prior marginal probabilities of the given node.double[]calculateUpdatedMarginals(int nodeIndex) Calculates the updated marginal probabilities of the given node, given the evidence.Returns the evidence for the updater.doublegetJointMarginal(int[] variables, int[] values) Returns the joint marginal probability of the given variables taking the given values, given the evidence.doublegetMarginal(int variable, int category) Returns the marginal probability of the given variable taking the given value, given the evidence.booleanReturns the joint marginal probability of the given variables taking the given values, given the evidence.voidsetEvidence(Evidence evidence) Sets new evidence for the updater.
- 
Method Details- 
getMarginaldouble getMarginal(int variable, int category) Returns the marginal probability of the given variable taking the given value, given the evidence.- Parameters:
- variable- variable index
- category- category index
- Returns:
- P(variable = value | evidence), where evidence is getEvidence().
 
- 
isJointMarginalSupportedboolean isJointMarginalSupported()Returns the joint marginal probability of the given variables taking the given values, given the evidence.- Returns:
- true if the getJointMarginal() method is supported.
 
- 
getJointMarginaldouble getJointMarginal(int[] variables, int[] values) Returns the joint marginal probability of the given variables taking the given values, given the evidence.- Parameters:
- variables- variable indices
- values- category indices
- Returns:
- P(variables[i] = values[i] | evidence), where evidence is getEvidence().
 
- 
setEvidenceSets new evidence for the updater. Once this is called, old updating results should not longer be available.- Parameters:
- evidence- evidence
 
- 
getBayesImBayesIm getBayesIm()Returns the evidence for the updater.- Returns:
- the Bayes instantiated model that is being updated.
 
- 
calculatePriorMarginalsdouble[] calculatePriorMarginals(int nodeIndex) Calculates the prior marginal probabilities of the given node.- Parameters:
- nodeIndex- node index
- Returns:
- P(node = value), where value is the value of the node in the Bayes net.
 
- 
calculateUpdatedMarginalsdouble[] calculateUpdatedMarginals(int nodeIndex) Calculates the updated marginal probabilities of the given node, given the evidence.- Parameters:
- nodeIndex- node index
- Returns:
- P(node = value | evidence), where value is the value of the node in the Bayes net.
 
 
-