Package edu.cmu.tetrad.bayes
Class BayesImProbs
java.lang.Object
edu.cmu.tetrad.bayes.BayesImProbs
- All Implemented Interfaces:
TetradSerializable
,Serializable
Calculates cell probabilities from conditional BayesIm probabilities on the fly without constructing the entire
table. (To force the entire table to be constructed, use StoredCellProbs.)
- Author:
- josephramsey
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBayesImProbs
(BayesIm bayesIm) Constructs a BayesImProbs object from the given BayesIm. -
Method Summary
Modifier and TypeMethodDescriptiondouble
getCellProb
(int[] variableValues) Calculates the probability in the given cell from the conditional probabilities in the BayesIm.double
getConditionalProb
(Proposition assertion, Proposition condition) double
getProb
(Proposition assertion) static BayesImProbs
Generates a simple exemplar of this class to test serialization.
-
Constructor Details
-
BayesImProbs
Constructs a BayesImProbs object from the given BayesIm.- Parameters:
bayesIm
- Ibid.
-
-
Method Details
-
serializableInstance
Generates a simple exemplar of this class to test serialization.- Returns:
- a simple exemplar of this class to test serialization.
-
getCellProb
public double getCellProb(int[] variableValues) Calculates the probability in the given cell from the conditional probabilities in the BayesIm. It's the product of the probabilities that each variable takes on the value it does given that the other variables take on the values they do in that cell. The returned value will be undefined (Double.NaN) if any of the conditional probabilities being multiplied together is undefined.- Returns:
- the cell probability, or NaN if this probability is undefined.
-
getProb
-
getConditionalProb
-
getVariables
-