Class CellTableProbs

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

public final class CellTableProbs extends Object
Estimates probabilities from data by constructing the entire cell count table for the data.
Version:
$Id: $Id
Author:
josephramsey
  • Constructor Details

    • CellTableProbs

      public CellTableProbs(DataSet dataSet)
      Creates a cell count table for the given data set.
      Parameters:
      dataSet - the data set to be used in the table.
  • 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 for the given proposition.
      Parameters:
      assertion - the proposition object to calculate the probability for.
      Returns:
      the calculated probability for the given proposition.
    • getConditionalProb

      public double getConditionalProb(Proposition assertion, Proposition condition)
      Calculates the conditional probability of an assertion given a condition.
      Parameters:
      assertion - the proposition object representing the assertion
      condition - the proposition object 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 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.