Package edu.cmu.tetrad.bayes
Class JunctionTreeUpdater
java.lang.Object
edu.cmu.tetrad.bayes.JunctionTreeUpdater
- All Implemented Interfaces:
BayesUpdater,ManipulatingBayesUpdater,TetradSerializable,Serializable
Jan 21, 2020 11:03:09 AM
- Author:
- Kevin V. Bui (kvb2@pitt.edu)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionJunctionTreeUpdater(BayesIm bayesIm) JunctionTreeUpdater(BayesIm bayesIm, Evidence evidence) -
Method Summary
Modifier and TypeMethodDescriptiondouble[]calculatePriorMarginals(int nodeIndex) double[]calculateUpdatedMarginals(int nodeIndex) doublegetJointMarginal(int[] variables, int[] values) doublegetMarginal(int variable, int category) booleanvoidsetEvidence(Evidence evidence) Sets new evidence for the updater.toString()
-
Constructor Details
-
JunctionTreeUpdater
-
JunctionTreeUpdater
-
-
Method Details
-
getManipulatedBayesIm
- Specified by:
getManipulatedBayesImin interfaceManipulatingBayesUpdater- Returns:
- the Bayes instantiated model after manipulations have been applied.
-
getManipulatedGraph
- Specified by:
getManipulatedGraphin interfaceManipulatingBayesUpdater- Returns:
- the graph for the manipulated BayesIm.
-
getEvidence
- Specified by:
getEvidencein interfaceManipulatingBayesUpdater- Returns:
- a defensive copy of the evidence.
-
setEvidence
Description copied from interface:ManipulatingBayesUpdaterSets new evidence for the updater. Once this is called, old updating results should not longer be available.- Specified by:
setEvidencein interfaceBayesUpdater- Specified by:
setEvidencein interfaceManipulatingBayesUpdater
-
getUpdatedBayesIm
- Specified by:
getUpdatedBayesImin interfaceManipulatingBayesUpdater- Returns:
- the updated Bayes IM--that is, the Bayes IM in which all probabilities of variables conditional on their parents have been updated.
-
getMarginal
public double getMarginal(int variable, int category) - Specified by:
getMarginalin interfaceBayesUpdater- Specified by:
getMarginalin interfaceManipulatingBayesUpdater- Returns:
- P(variable = category | evidence) where evidence is getEvidence().
-
isJointMarginalSupported
public boolean isJointMarginalSupported()- Specified by:
isJointMarginalSupportedin interfaceBayesUpdater- Returns:
- true if the getJointMarginal() method is supported.
-
getJointMarginal
public double getJointMarginal(int[] variables, int[] values) - Specified by:
getJointMarginalin interfaceBayesUpdater- Returns:
- P(variables[i] = values[i] | evidence), where evidence is getEvidence().
-
getBayesIm
- Specified by:
getBayesImin interfaceBayesUpdater- Returns:
- the Bayes instantiated model that is being updated.
-
calculatePriorMarginals
public double[] calculatePriorMarginals(int nodeIndex) - Specified by:
calculatePriorMarginalsin interfaceBayesUpdater
-
calculateUpdatedMarginals
public double[] calculateUpdatedMarginals(int nodeIndex) - Specified by:
calculateUpdatedMarginalsin interfaceBayesUpdater
-
toString
-