Interface BayesUpdater

All Superinterfaces:
Serializable, TetradSerializable
All Known Subinterfaces:
ManipulatingBayesUpdater
All Known Implementing Classes:
ApproximateUpdater, CptInvariantUpdater, Identifiability, JunctionTreeUpdater, RowSummingExactUpdater

public interface BayesUpdater extends TetradSerializable
Interface for a discrete Bayes updating algorithm. The main task of such and algorithm is to calculate P(X = x' | evidence), where evidence takes the form of a Proposition over the variables in the Bayes net, possibly with additional information about which variables in the Bayes net have been manipulated. Some updaters may be able to calculate joint marginals as well--that is, P(AND_i{Xi = xi'} | evidence). Also, not all updaters can take manipulation information into account. See implementations for details.
Author:
josephramsey
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
     
  • Method Summary

    Modifier and Type
    Method
    Description
    double[]
    calculatePriorMarginals(int nodeIndex)
    Calculates the prior marginal probabilities of the given node.
    double[]
    Calculates the updated marginal probabilities of the given node, given the evidence.
    Returns the evidence for the updater.
    double
    getJointMarginal(int[] variables, int[] values)
    Returns the joint marginal probability of the given variables taking the given values, given the evidence.
    double
    getMarginal(int variable, int category)
    Returns the marginal probability of the given variable taking the given value, given the evidence.
    boolean
    Returns the joint marginal probability of the given variables taking the given values, given the evidence.
    void
    Sets new evidence for the updater.
  • Field Details

  • Method Details

    • getMarginal

      double getMarginal(int variable, int category)
      Returns the marginal probability of the given variable taking the given value, given the evidence.
      Parameters:
      variable - variable index
      category - category index
      Returns:
      P(variable = value | evidence), where evidence is getEvidence().
    • isJointMarginalSupported

      boolean isJointMarginalSupported()
      Returns the joint marginal probability of the given variables taking the given values, given the evidence.
      Returns:
      true if the getJointMarginal() method is supported.
    • getJointMarginal

      double getJointMarginal(int[] variables, int[] values)
      Returns the joint marginal probability of the given variables taking the given values, given the evidence.
      Parameters:
      variables - variable indices
      values - category indices
      Returns:
      P(variables[i] = values[i] | evidence), where evidence is getEvidence().
    • setEvidence

      void setEvidence(Evidence evidence)
      Sets new evidence for the updater. Once this is called, old updating results should not longer be available.
      Parameters:
      evidence - evidence
    • getBayesIm

      BayesIm getBayesIm()
      Returns the evidence for the updater.
      Returns:
      the Bayes instantiated model that is being updated.
    • calculatePriorMarginals

      double[] calculatePriorMarginals(int nodeIndex)
      Calculates the prior marginal probabilities of the given node.
      Parameters:
      nodeIndex - node index
      Returns:
      P(node = value), where value is the value of the node in the Bayes net.
    • calculateUpdatedMarginals

      double[] calculateUpdatedMarginals(int nodeIndex)
      Calculates the updated marginal probabilities of the given node, given the evidence.
      Parameters:
      nodeIndex - node index
      Returns:
      P(node = value | evidence), where value is the value of the node in the Bayes net.