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
- Version:
- $Id: $Id
- Author:
- Kevin V. Bui (kvb2@pitt.edu)
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionJunctionTreeUpdater(BayesIm bayesIm) Constructor for JunctionTreeUpdater.JunctionTreeUpdater(BayesIm bayesIm, Evidence evidence) Constructor for JunctionTreeUpdater.
- 
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.Returns the manipulation that was used to manipulate the Bayes IM.doublegetJointMarginal(int[] variables, int[] values) Returns the joint marginal probability of the given variables taking the given values, given the evidence.Returns the manipulated Bayes IM.Returns the manipulated graph.doublegetMarginal(int variable, int category) Returns the marginal probability of the given variable taking the given value, given the evidence.Returns the updated Bayes IM.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.toString()
- 
Constructor Details
- 
Method Details- 
getManipulatedBayesImReturns the manipulated Bayes IM. This is the Bayes IM in which the variables in the manipulation have been removed from the graph.- Specified by:
- getManipulatedBayesImin interface- ManipulatingBayesUpdater
- Returns:
- the Bayes instantiated model after manipulations have been applied.
 
- 
getManipulatedGraphReturns the manipulated graph. This is the graph in which the variables in the manipulation have been removed from the graph.- Specified by:
- getManipulatedGraphin interface- ManipulatingBayesUpdater
- Returns:
- the graph for the manipulated BayesIm.
 
- 
getEvidenceReturns the manipulation that was used to manipulate the Bayes IM.- Specified by:
- getEvidencein interface- ManipulatingBayesUpdater
- Returns:
- a defensive copy of the evidence.
 
- 
setEvidenceSets 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:
- setEvidencein interface- BayesUpdater
- Specified by:
- setEvidencein interface- ManipulatingBayesUpdater
- Parameters:
- evidence- evidence
 
- 
getUpdatedBayesImReturns the updated Bayes IM. This is the Bayes IM in which all probabilities of variables conditional on their parents have been updated.- Specified by:
- getUpdatedBayesImin interface- ManipulatingBayesUpdater
- Returns:
- the updated Bayes IM--that is, the Bayes IM in which all probabilities of variables conditional on their parents have been updated.
 
- 
getMarginalpublic 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:
- getMarginalin interface- BayesUpdater
- Specified by:
- getMarginalin interface- ManipulatingBayesUpdater
- Parameters:
- variable- variable index
- category- category index
- Returns:
- P(variable = value | evidence), where evidence is getEvidence().
 
- 
isJointMarginalSupportedpublic boolean isJointMarginalSupported()Returns the joint marginal probability of the given variables taking the given values, given the evidence.- Specified by:
- isJointMarginalSupportedin interface- BayesUpdater
- Returns:
- true if the getJointMarginal() method is supported.
 
- 
getJointMarginalpublic double getJointMarginal(int[] variables, int[] values) Returns the joint marginal probability of the given variables taking the given values, given the evidence.- Specified by:
- getJointMarginalin interface- BayesUpdater
- Parameters:
- variables- variable indices
- values- category indices
- Returns:
- P(variables[i] = values[i] | evidence), where evidence is getEvidence().
 
- 
getBayesImReturns the evidence for the updater.- Specified by:
- getBayesImin interface- BayesUpdater
- Returns:
- the Bayes instantiated model that is being updated.
 
- 
calculatePriorMarginalspublic double[] calculatePriorMarginals(int nodeIndex) Calculates the prior marginal probabilities of the given node.- Specified by:
- calculatePriorMarginalsin interface- BayesUpdater
- Parameters:
- nodeIndex- node index
- Returns:
- P(node = value), where value is the value of the node in the Bayes net.
 
- 
calculateUpdatedMarginalspublic double[] calculateUpdatedMarginals(int nodeIndex) Calculates the updated marginal probabilities of the given node, given the evidence.- Specified by:
- calculateUpdatedMarginalsin interface- BayesUpdater
- Parameters:
- nodeIndex- node index
- Returns:
- P(node = value | evidence), where value is the value of the node in the Bayes net.
 
- 
toString
 
-