Package edu.cmu.tetrad.search.score
Class BdeScore
java.lang.Object
edu.cmu.tetrad.search.score.BdeScore
- All Implemented Interfaces:
- DiscreteScore,- Score
Calculates the BDe score (Bayes Dirichlet Equivalent) score for analyzing discrete multinomial data. A good
 discussion of BD* scores can be found here:
 
Heckerman, D., Geiger, D. & Chickering, D.M. Learning Bayesian networks: The combination of knowledge and statistical data. Mach Learn 20, 197–243 (1995).
As for all scores in Tetrad, higher scores mean more dependence, and negative scores indicate independence.
- Version:
- $Id: $Id
- Author:
- josephramsey
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionReturns the DataSet associated with this method.intGets the maximum degree of the BDe Score.intReturns the sample size of the data set.Returns the variables present in the DataSet associated with this method.booleanisEffectEdge(double bump) Determines if an edge has an effect.doublelocalScore(int i, int[] parents) Returns the score for the given parent given its parents, where these are specified as column indices into the dataset.doublelocalScoreDiff(int x, int y, int[] z) Returns the score difference of the graph.voidsetSamplePrior(double samplePrior) Sets the sample prior for the BDe score.voidsetStructurePrior(double structurePrior) Sets the structure prior for the BDe score.toString()Returns a string representation of the object.Methods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface edu.cmu.tetrad.search.score.Scoreappend, determines, getVariable, localScore, localScore, localScoreDiff
- 
Constructor Details- 
BdeScoreConstructs a BDe score for the given dataset.- Parameters:
- dataSet- A discrete dataset.
 
 
- 
- 
Method Details- 
localScorepublic double localScore(int i, int[] parents) Returns the score for the given parent given its parents, where these are specified as column indices into the dataset.- Specified by:
- localScorein interface- Score
- Parameters:
- i- The index of the variable.
- parents- The indices of the parents of the variables.
- Returns:
- the score, or NaN if the score can't be calculated.
 
- 
localScoreDiffpublic double localScoreDiff(int x, int y, int[] z) Returns the score difference of the graph.Returns the difference between localScore(y | z, x) and localScore(y | z) - Specified by:
- localScoreDiffin interface- Score
- Parameters:
- x- A node.
- y- TAhe node.
- z- A set of nodes.
- Returns:
- The score difference.
 
- 
getDataSetReturns the DataSet associated with this method.- Specified by:
- getDataSetin interface- DiscreteScore
- Returns:
- The DataSet object.
 
- 
setStructurePriorpublic void setStructurePrior(double structurePrior) Sets the structure prior for the BDe score.- Specified by:
- setStructurePriorin interface- DiscreteScore
- Parameters:
- structurePrior- The structure prior value.
 
- 
setSamplePriorpublic void setSamplePrior(double samplePrior) Sets the sample prior for the BDe score.- Specified by:
- setSamplePriorin interface- DiscreteScore
- Parameters:
- samplePrior- The sample prior value.
 
- 
getVariablesReturns the variables present in the DataSet associated with this method.- Specified by:
- getVariablesin interface- Score
- Returns:
- A list of Node objects representing the variables.
 
- 
getSampleSizepublic int getSampleSize()Returns the sample size of the data set.- Specified by:
- getSampleSizein interface- Score
- Returns:
- The sample size.
 
- 
isEffectEdgepublic boolean isEffectEdge(double bump) Determines if an edge has an effect.- Specified by:
- isEffectEdgein interface- Score
- Parameters:
- bump- The bump value.
- Returns:
- true if the bump value is greater than -20, false otherwise.
 
- 
getMaxDegreepublic int getMaxDegree()Gets the maximum degree of the BDe Score.- Specified by:
- getMaxDegreein interface- Score
- Returns:
- The maximum degree.
 
- 
toString
 
-