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 TypeMethodDescriptiondoublegetCellProb(int[] variableValues) getCellProb.doublegetConditionalProb(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.doublegetProb(Proposition assertion) Calculates the probability of the given assertion in the data set.getVariables.
-
Constructor Details
-
DataSetProbs
Creates a cell count table for the given data set.- Parameters:
dataSet- aDataSetobject
-
-
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- aPropositionobject representing the assertion values of variablescondition- aPropositionobject 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
getVariables.
- Returns:
- the list of variables for the dataset that this is estimating probabilities for.
-