java.lang.Object
edu.pitt.dbmi.algo.bayesian.constraint.inference.BCInference

public class BCInference extends Object
Feb 26, 2014 8:07:20 PM
Author:
Kevin V. Bui (kvb2@pitt.edu)
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    BCInference(int[][] cases, int[] nodeDimension)
    Cases is a two-dimensional array dataset.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected double
    lnXpluslnY(double lnX, double lnY)
    Takes ln(x) and ln(y) as input, and returns ln(x + y)
    double
    probConstraint(BCInference.OP constraint, int x, int y, int[] z)
    This function takes a constraint, which has a value of either OP.dependent or OP.independent, of the form "X independent Y given Z" or "X dependent Y given Z" and returns a probability for that constraint given the data in cases and assumed prior probability for that constraint given the data in cases and assumed prior probabilities.
    void
    setPriorEqivalentSampleSize(double priorEquivalentSampleSize)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BCInference

      public BCInference(int[][] cases, int[] nodeDimension)
      Cases is a two-dimensional array dataset. If the dataset is M x N, the size of the two-dimensional array is (M + 2) x (N + 2). In other words, the size of the array is always 2 more of the number of data. Likewise, if the data for nodeDimension is N then the size of the array is N + 2.

      The case array index starts from 1 (not zero) to numberOfCases. The nodeDimension array index start from 1 (not zero) to numberOfNodes.

      nodeDimension array contains values denote the number of discrete values that Node can have (e.g., 2 for a binary variable).

      Parameters:
      cases - is a two-dimensional integer array containing the data
      nodeDimension - one-dimensional integer array containing the dimension of each variable
  • Method Details

    • probConstraint

      public double probConstraint(BCInference.OP constraint, int x, int y, int[] z)
      This function takes a constraint, which has a value of either OP.dependent or OP.independent, of the form "X independent Y given Z" or "X dependent Y given Z" and returns a probability for that constraint given the data in cases and assumed prior probability for that constraint given the data in cases and assumed prior probabilities. Currently, it assumes uniform parameter priors and a structure prior of 0.5. A structure prior of 0.5 means taht a priori we have that P(X independent Y given Z) = P(X dependent Y given Z) = 0.5.

      Z[0] is the length of the set represented by array Z. For an example, Z[0] = 1 represents the set Z of size 1. Z[] = 0 represents an empty set.

      Set Z with two elements: Z = {3, 2} Z[] = 2 // set Z has two elements (length of 2) Z[1] = 3 // first element Z[2] = 2 // second element.

      Empty set: Z = {}; Z[0] = 0

      Parameters:
      constraint - has the value OP.independent or OP.dependent
      x - node x
      y - node y
      z - set of nodes
      Returns:
      P(x dependent y given z | data) or P(x independent y given z | data)
    • lnXpluslnY

      protected double lnXpluslnY(double lnX, double lnY)
      Takes ln(x) and ln(y) as input, and returns ln(x + y)
      Parameters:
      lnX - is natural log of x
      lnY - is natural log of y
      Returns:
      natural log of x plus y
    • setPriorEqivalentSampleSize

      public void setPriorEqivalentSampleSize(double priorEquivalentSampleSize)