Class DataSetProbs

java.lang.Object
edu.cmu.tetrad.bayes.DataSetProbs

public final class DataSetProbs extends Object
Estimates maximum likelihood probabilities directly from data on the fly.
Version:
$Id: $Id
Author:
josephramsey
  • Constructor Details

    • DataSetProbs

      public DataSetProbs(DataSet dataSet)
      Creates a cell count table for the given data set.
      Parameters:
      dataSet - a DataSet object
  • Method Details

    • getCellProb

      public double getCellProb(int[] variableValues)

      getCellProb.

      Parameters:
      variableValues - an array of
      invalid reference
      int
      objects
      Returns:
      the estimated probability for the given cell. The order of the variable values is the order of the variables in getVariable().
    • getProb

      public double getProb(Proposition assertion)
      Calculates the probability of the given assertion being true in the dataset.
      Parameters:
      assertion - The proposition to be evaluated. It should be of type Proposition.
      Returns:
      The probability of the assertion being true as a double value.
    • getConditionalProb

      public double getConditionalProb(Proposition assertion, Proposition condition)
      Calculates the conditional probability of the given assertion being true, given the condition, in the dataset.
      Parameters:
      assertion - a Proposition object representing the assertion.
      condition - a Proposition object representing the condition.
      Returns:
      the conditional probability of the assertion being true, given the condition, as a double value.
      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

      public DataSet getDataSet()

      Getter for the field dataSet.

      Returns:
      the dataset that this is estimating probabilities for.
    • getVariables

      public List<Node> getVariables()

      getVariables.

      Returns:
      the list of variables for the dataset that this is estimating probabilities for.