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.)
- Version:
- $Id: $Id
- Author:
- josephramsey
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionBayesImProbs(BayesIm bayesIm) Constructs a BayesImProbs object from the given BayesIm.
- 
Method SummaryModifier and TypeMethodDescriptiondoublegetCellProb(int[] variableValues) Calculates the probability in the given cell from the conditional probabilities in the BayesIm.doublegetConditionalProb(Proposition assertion, Proposition condition) Calculates the conditional probability of an assertion given a condition.doublegetProb(Proposition assertion) Calculates the probability of a given proposition.Getter for the fieldvariables.static BayesImProbsGenerates a simple exemplar of this class to test serialization.
- 
Constructor Details- 
BayesImProbsConstructs a BayesImProbs object from the given BayesIm.- Parameters:
- bayesIm- Ibid.
 
 
- 
- 
Method Details- 
serializableInstanceGenerates a simple exemplar of this class to test serialization.- Returns:
- a simple exemplar of this class to test serialization.
 
- 
getCellProbpublic 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.- Parameters:
- variableValues- the values of the variables in the cell
- Returns:
- the cell probability, or NaN if this probability is undefined.
 
- 
getProbCalculates the probability of a given proposition.- Parameters:
- assertion- the proposition for which we want to calculate the probability
- Returns:
- the probability of the given proposition
 
- 
getConditionalProbCalculates the conditional probability of an assertion given a condition.- Parameters:
- assertion- the proposition representing the assertion
- condition- the proposition representing the condition
- Returns:
- the conditional probability of the assertion given the condition
- Throws:
- IllegalArgumentException- if the assertion and condition are not for the same Bayes IM
 
- 
getVariablesGetter for the field variables.- Returns:
- a Listobject
 
 
-