Class IntAveDataSetProbs

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

public final class IntAveDataSetProbs extends Object
Estimates probabilities directly from data on the fly using maximum likelihood method, with the exception that if rows do not exist in the data satisfying a required condition because certain values are unattested, an attempt is made to remove each relevant column in turn, record the estimated probability with column removed from the condition (if it is defined), and then return the average over the estimated probabilities calculated this way.
Version:
$Id: $Id
Author:
josephramsey
  • Constructor Details

    • IntAveDataSetProbs

      public IntAveDataSetProbs(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 a given assertion.
      Parameters:
      assertion - an object of type Proposition representing the assertion
      Returns:
      the probability of the given assertion
    • getConditionalProb

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