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 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)
      This method calculates the probability of a given proposition.
      Parameters:
      assertion - a Proposition object representing the proposition for which the probability is calculated.
      Returns:
      the probability of the given proposition.
    • getConditionalProb

      public double getConditionalProb(Proposition assertion, Proposition condition)
      Calculates the conditional probability of an assertion given a condition.
      Parameters:
      assertion - A Proposition representing the assertion.
      condition - A Proposition 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 variables in the assertion and data set are either 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.