Package edu.cmu.tetrad.search.score
Class BdeuScore
java.lang.Object
edu.cmu.tetrad.search.score.BdeuScore
- All Implemented Interfaces:
- DiscreteScore,- Score
Calculates the BDeu score, which the BDe (Bayes Dirichlet Equivalent) score with uniform priors. 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 TypeMethodDescriptionbooleandetermines(List<Node> z, Node y) Determines whether a set of nodes z determines a specific node y.Retrieves the dataset associated with this BdeuScore object.intReturns the maximum degree of the BDeuScore object.doubleReturns the sample prior.intReturns the sample size of the data.doubleRetrieves the structure prior associated with this BdeuScore object.Retrieves the list of variables used in the object.booleanisEffectEdge(double bump) Determines whether the bump exceeds zero.doublelocalScore(int node, int[] parents) Calculates the local score of a node given its parents.doublelocalScoreDiff(int x, int y, int[] z) Calculates the difference in local scores between two nodes y and x, when x is added to a set of nodes z.voidsetSamplePrior(double samplePrior) Sets the sample prior for the BdeuScore object.voidsetStructurePrior(double structurePrior) Sets the structure prior for the BdeuScore object.toString()Returns a string representation of this BDeu Score object.Methods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface edu.cmu.tetrad.search.score.Scoreappend, getVariable, localScore, localScore, localScoreDiff
- 
Constructor Details- 
BdeuScoreConstructs a BDe score for the given dataset.- Parameters:
- dataSet- A discrete dataset.
 
 
- 
- 
Method Details- 
localScorepublic double localScore(int node, int[] parents) Calculates the local score of a node given its parents.- Specified by:
- localScorein interface- Score
- Parameters:
- node- The node.
- parents- The parents of the node.
- Returns:
- The local score of the node.
 
- 
localScoreDiffpublic double localScoreDiff(int x, int y, int[] z) Calculates the difference in local scores between two nodes y and x, when x is added to a set of nodes z.- Specified by:
- localScoreDiffin interface- Score
- Parameters:
- x- A node.
- y- The node.
- z- A set of nodes.
- Returns:
- The difference in local scores between y and x added to z.
 
- 
getVariablesRetrieves the list of variables used in the object.- Specified by:
- getVariablesin interface- Score
- Returns:
- A list of Node objects representing the variables used.
 
- 
getSampleSizepublic int getSampleSize()Returns the sample size of the data.- Specified by:
- getSampleSizein interface- Score
- Returns:
- This size.
 
- 
isEffectEdgepublic boolean isEffectEdge(double bump) Determines whether the bump exceeds zero.- Specified by:
- isEffectEdgein interface- Score
- Parameters:
- bump- The bump value.
- Returns:
- trueif the bump is greater than zero, otherwise- false.
 
- 
getDataSetRetrieves the dataset associated with this BdeuScore object.- Specified by:
- getDataSetin interface- DiscreteScore
- Returns:
- The dataset.
 
- 
getStructurePriorpublic double getStructurePrior()Retrieves the structure prior associated with this BdeuScore object.- Returns:
- The structure prior.
 
- 
setStructurePriorpublic void setStructurePrior(double structurePrior) Sets the structure prior for the BdeuScore object.- Specified by:
- setStructurePriorin interface- DiscreteScore
- Parameters:
- structurePrior- The structure prior to be set.
 
- 
getSamplePriorpublic double getSamplePrior()Returns the sample prior.- Returns:
- This prior.
 
- 
setSamplePriorpublic void setSamplePrior(double samplePrior) Sets the sample prior for the BdeuScore object.- Specified by:
- setSamplePriorin interface- DiscreteScore
- Parameters:
- samplePrior- The sample prior to be set.
 
- 
toString
- 
getMaxDegreepublic int getMaxDegree()Returns the maximum degree of the BDeuScore object.The maximum degree is calculated as the ceiling value of the logarithm of the sample size. - Specified by:
- getMaxDegreein interface- Score
- Returns:
- The maximum degree.
 
- 
determinesDetermines whether a set of nodes z determines a specific node y.- Specified by:
- determinesin interface- Score
- Parameters:
- z- The set of nodes.
- y- The node to be determined.
- Returns:
- trueif the set of nodes z determines the node y,- falseotherwise.
- Throws:
- UnsupportedOperationException- The BDeu score does not implement a 'determines' method.
 
 
-