Package edu.cmu.tetrad.bayes
Interface ManipulatingBayesUpdater
- All Superinterfaces:
BayesUpdater
,Serializable
,TetradSerializable
- All Known Implementing Classes:
ApproximateUpdater
,CptInvariantUpdater
,Identifiability
,JunctionTreeUpdater
,RowSummingExactUpdater
Interface for a Bayes updating algorithm that's capable of doing manipulation. In general, manipulating a variable X
will eliminate edges into X, so the updating operation on the manipulated model will produce different results.
- Version:
- $Id: $Id
- Author:
- josephramsey
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final long
ConstantserialVersionUID=23L
-
Method Summary
Modifier and TypeMethodDescriptionReturns the manipulation that was used to manipulate the Bayes IM.Returns the manipulated Bayes IM.Returns the manipulated graph.double
getMarginal
(int variable, int category) Returns the marginal probability of the given variable taking the given value, given the evidence.Returns the updated Bayes IM.void
setEvidence
(Evidence evidence) Sets new evidence for the updater.Methods inherited from interface edu.cmu.tetrad.bayes.BayesUpdater
calculatePriorMarginals, calculateUpdatedMarginals, getBayesIm, getJointMarginal, isJointMarginalSupported
-
Field Details
-
serialVersionUID
static final long serialVersionUIDConstantserialVersionUID=23L
- See Also:
-
-
Method Details
-
getManipulatedBayesIm
BayesIm getManipulatedBayesIm()Returns the manipulated Bayes IM. This is the Bayes IM in which the variables in the manipulation have been removed from the graph.- Returns:
- the Bayes instantiated model after manipulations have been applied.
-
getManipulatedGraph
Graph getManipulatedGraph()Returns the manipulated graph. This is the graph in which the variables in the manipulation have been removed from the graph.- Returns:
- the graph for the manipulated BayesIm.
-
getEvidence
Evidence getEvidence()Returns the manipulation that was used to manipulate the Bayes IM.- Returns:
- a defensive copy of the evidence.
-
setEvidence
Sets new evidence for the updater. Once this is called, old updating results should not longer be available.Sets new evidence for the updater. Once this is called, old updating results should not longer be available.
- Specified by:
setEvidence
in interfaceBayesUpdater
- Parameters:
evidence
- evidence
-
getUpdatedBayesIm
BayesIm getUpdatedBayesIm()Returns the updated Bayes IM. This is the Bayes IM in which all probabilities of variables conditional on their parents have been updated.- Returns:
- the updated Bayes IM--that is, the Bayes IM in which all probabilities of variables conditional on their parents have been updated.
-
getMarginal
double getMarginal(int variable, int category) Returns the marginal probability of the given variable taking the given value, given the evidence.Returns the updated graph. This is the graph in which all probabilities of variables conditional on their parents have been updated.
- Specified by:
getMarginal
in interfaceBayesUpdater
- Parameters:
variable
- variable indexcategory
- category index- Returns:
- P(variable = value | evidence), where evidence is getEvidence().
-