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) Getter for the fielddataSet
.double
getProb
(Proposition assertion) Calculates the probability of a given assertion.getVariables.
-
Constructor Details
-
IntAveDataSetProbs
Creates a cell count table for the given data set.- Parameters:
dataSet
- aDataSet
object
-
-
Method Details
-
getCellProb
public double getCellProb(int[] variableValues) getCellProb.
- Parameters:
variableValues
- an array ofinvalid reference
int
- 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
- The proposition to evaluate.- Returns:
- The probability of the given assertion.
-
getConditionalProb
-
getDataSet
Getter for the field
dataSet
.- Returns:
- the dataset that this is estimating probabilities for.
-
getVariables
getVariables.
- Returns:
- the list of variables for the dataset that this is estimating probabilities for.
-