Package edu.cmu.tetrad.bayes
Class IntAveDataSetProbs
java.lang.Object
edu.cmu.tetrad.bayes.IntAveDataSetProbs
Estimates probabilities directly from data on the fly using maximum likelihood method, with the exception that if
rows do not exist in the data satisfying a required condition because certain values are unattested, an attempt is
made to remove each relevant column in turn, record the estimated probability with column removed from the condition
(if it is defined), and then return the average over the estimated probabilities calculated this way.
- Version:
- $Id: $Id
- Author:
- josephramsey
-
Constructor Summary
ConstructorsConstructorDescriptionIntAveDataSetProbs
(DataSet dataSet) Creates a cell count table for the given data set. -
Method Summary
Modifier and TypeMethodDescriptiondouble
getCellProb
(int[] variableValues) getCellProb.double
getConditionalProb
(Proposition assertion, Proposition condition) Calculates the conditional probability of an assertion given a condition.Getter for the fielddataSet
.double
getProb
(Proposition assertion) Calculates the probability of a given assertion.getVariables.
-
Constructor Details
-
IntAveDataSetProbs
-
-
Method Details
-
getCellProb
public double getCellProb(int[] variableValues) getCellProb.
- Parameters:
variableValues
- an array of objects- Returns:
- the estimated probability for the given cell. The order of the variable values is the order of the variables in getVariable().
-
getProb
Calculates the probability of a given assertion.- Parameters:
assertion
- an object of type Proposition representing the assertion- Returns:
- the probability of the given assertion
-
getConditionalProb
Calculates 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 or if the variables in the assertion and data set are different or in a different order.
-
getDataSet
Getter for the field
dataSet
.- Returns:
- the dataset that this is estimating probabilities for.
-
getVariables
-