Class BCInference
java.lang.Object
edu.pitt.dbmi.algo.bayesian.constraint.inference.BCInference
Feb 26, 2014 8:07:20 PM
- Version:
- $Id: $Id
- Author:
- Kevin V. Bui (kvb2@pitt.edu)
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionBCInference
(int[][] cases, int[] nodeDimension) Cases is a two-dimensional array dataset. -
Method Summary
Modifier and TypeMethodDescriptiondouble
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) Sets the prior equivalent sample size.
-
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 datanodeDimension
- one-dimensional integer array containing the dimension of each variable
-
-
Method Details
-
probConstraint
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.dependentx
- node xy
- node yz
- set of nodes- Returns:
- P(x dependent y given z | data) or P(x independent y given z | data)
-
setPriorEqivalentSampleSize
public void setPriorEqivalentSampleSize(double priorEquivalentSampleSize) Sets the prior equivalent sample size.- Parameters:
priorEquivalentSampleSize
- the prior equivalent sample size
-