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 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 in the data set.
      Parameters:
      assertion - the proposition representing the values of variables
      Returns:
      the probability of the assertion in the data set
    • getConditionalProb

      public double getConditionalProb(Proposition assertion, Proposition condition)
      Calculates the conditional probability of an assertion given a condition in a Bayes information model (Bayes IM).
      Parameters:
      assertion - a Proposition object representing the assertion values of variables
      condition - a Proposition 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

      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.