Package edu.cmu.tetrad.bayes
Class DataSetProbs
java.lang.Object
edu.cmu.tetrad.bayes.DataSetProbs
Estimates maximum likelihood probabilities directly from data on the fly.
- Version:
- $Id: $Id
- Author:
- josephramsey
-
Constructor Summary
ConstructorsConstructorDescriptionDataSetProbs
(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 in a Bayes information model (Bayes IM).Getter for the fielddataSet
.double
getProb
(Proposition assertion) Calculates the probability of the given assertion in the data set.getVariables.
-
Constructor Details
-
DataSetProbs
-
-
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 the given assertion in the data set.- Parameters:
assertion
- the proposition representing the values of variables- Returns:
- the probability of the assertion in the data set
-
getConditionalProb
Calculates the conditional probability of an assertion given a condition in a Bayes information model (Bayes IM).- Parameters:
assertion
- aProposition
object representing the assertion values of variablescondition
- aProposition
object representing the condition values of variables- 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 assertion variable and data variables are different or in a different order
-
getDataSet
Getter for the field
dataSet
.- Returns:
- the dataset that this is estimating probabilities for.
-
getVariables
-