Package edu.cmu.tetrad.bayes
Class CptInvariantMarginalCalculator
java.lang.Object
edu.cmu.tetrad.bayes.CptInvariantMarginalCalculator
- All Implemented Interfaces:
TetradSerializable
,Serializable
Calculates marginals of the form P(V=v') for an updated Bayes net for purposes of the CPT Invariant Updater.
- Version:
- $Id: $Id
- Author:
- josephramsey
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCptInvariantMarginalCalculator
(BayesIm bayesIm, Evidence evidence) Constructs a new marginal calculator for the given updated Bayes IM. -
Method Summary
Modifier and TypeMethodDescriptiondouble
getMarginal
(int variable, int category) getMarginal.Getter for the fieldupdatedBayesIm
.Generates a simple exemplar of this class to test serialization.
-
Constructor Details
-
CptInvariantMarginalCalculator
Constructs a new marginal calculator for the given updated Bayes IM. It is assumed that the first BayesIm encountered on calling the getParentIm() method recursively is the Bayes IM with respect to which conjunctions of the form P(V1=v1' and V2=v2' and ... and Vn=vn') should be calculated.
-
-
Method Details
-
serializableInstance
Generates a simple exemplar of this class to test serialization.- Returns:
- a
CptInvariantMarginalCalculator
object
-
getMarginal
public double getMarginal(int variable, int category) getMarginal.
- Parameters:
variable
- a intcategory
- a int- Returns:
- P(variable = category).
-
getUpdatedBayesIm
Getter for the field
updatedBayesIm
.- Returns:
- a
UpdatedBayesIm
object
-