Class DirichletDataSetProbs

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

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

    • DirichletDataSetProbs

      public DirichletDataSetProbs(DataSet dataSet, double symmValue)
      Creates a cell count table for the given data set.
      Parameters:
      dataSet - a DataSet object
      symmValue - a double
  • 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)
      Retrieves the probability of the given assertion in the DirichletDataSetProbs.
      Parameters:
      assertion - The proposition to be checked for probability.
      Returns:
      The probability of the assertion as a double value.
    • getConditionalProb

      public double getConditionalProb(Proposition assertion, Proposition condition)
      Calculates the conditional probability of an assertion given a condition in the context of a Bayes IM.
      Parameters:
      assertion - the proposition representing the assertion
      condition - the proposition representing the condition
      Returns:
      the conditional probability 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.
    • isBoundsEnforced

      public boolean isBoundsEnforced()
      True iff bounds checking is performed on variable values indices.
      Returns:
      a boolean
    • setBoundsEnforced

      public void setBoundsEnforced(boolean boundsEnforced)
      True iff bounds checking is performed on variable values indices.
      Parameters:
      boundsEnforced - a boolean