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 Summary
Modifier 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.double
getJointMarginal
(int[] variables, int[] values) Returns the joint marginal probability of the given variables taking the given values, given the evidence.double
getMarginal
(int variable, int category) Returns the marginal probability of the given variable taking the given value, given the evidence.boolean
Returns the joint marginal probability of the given variables taking the given values, given the evidence.void
setEvidence
(Evidence evidence) Sets new evidence for the updater.
-
Method Details
-
getMarginal
double getMarginal(int variable, int category) Returns the marginal probability of the given variable taking the given value, given the evidence.- Parameters:
variable
- variable indexcategory
- category index- Returns:
- P(variable = value | evidence), where evidence is getEvidence().
-
isJointMarginalSupported
boolean 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.
-
getJointMarginal
double getJointMarginal(int[] variables, int[] values) Returns the joint marginal probability of the given variables taking the given values, given the evidence.- Parameters:
variables
- variable indicesvalues
- category indices- Returns:
- P(variables[i] = values[i] | evidence), where evidence is getEvidence().
-
setEvidence
Sets new evidence for the updater. Once this is called, old updating results should not longer be available.- Parameters:
evidence
- evidence
-
getBayesIm
BayesIm getBayesIm()Returns the evidence for the updater.- Returns:
- the Bayes instantiated model that is being updated.
-
calculatePriorMarginals
double[] 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.
-
calculateUpdatedMarginals
double[] 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.
-