Class BayesImProbs

java.lang.Object
edu.cmu.tetrad.bayes.BayesImProbs
All Implemented Interfaces:
TetradSerializable, Serializable

public final class BayesImProbs extends Object implements TetradSerializable
Calculates cell probabilities from conditional BayesIm probabilities on the fly without constructing the entire table. (To force the entire table to be constructed, use StoredCellProbs.)
Version:
$Id: $Id
Author:
josephramsey
See Also:
  • Constructor Details

    • BayesImProbs

      public BayesImProbs(BayesIm bayesIm)
      Constructs a BayesImProbs object from the given BayesIm.
      Parameters:
      bayesIm - Ibid.
  • Method Details

    • serializableInstance

      public static BayesImProbs serializableInstance()
      Generates a simple exemplar of this class to test serialization.
      Returns:
      a simple exemplar of this class to test serialization.
    • getCellProb

      public double getCellProb(int[] variableValues)
      Calculates the probability in the given cell from the conditional probabilities in the BayesIm. It's the product of the probabilities that each variable takes on the value it does given that the other variables take on the values they do in that cell. The returned value will be undefined (Double.NaN) if any of the conditional probabilities being multiplied together is undefined.
      Parameters:
      variableValues - an array of
      invalid reference
      int
      objects
      Returns:
      the cell probability, or NaN if this probability is undefined.
    • getProb

      public double getProb(Proposition assertion)
    • getConditionalProb

      public double getConditionalProb(Proposition assertion, Proposition condition)
    • getVariables

      public List<Node> getVariables()

      Getter for the field variables.

      Returns:
      a List object