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.
- Author:
- josephramsey
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the dataset being analyzed.intReturns the maximum degree of the graphs as they're searched.intReturns the sample size of the data.Returns the variables of the dataset.booleanisEffectEdge(double bump) Returns a judgment of whether the given bump in score allows one to conclude that the edge is an "effect edge" for FGES.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 different between localScore(y | z, x) and localScore(y | z)voidsetSamplePrior(double samplePrior) BDe does not use a sample prior.voidsetStructurePrior(double structurePrior) BDe does not use a structure prior.toString()Returns "BDe Score".Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface edu.cmu.tetrad.search.score.Score
append, determines, getVariable, localScore, localScore, localScoreDiff
-
Constructor Details
-
BdeScore
Constructs a BDe score for the given dataset.- Parameters:
dataSet- A discrete dataset.
-
-
Method Details
-
localScore
public 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 interfaceScore- 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.
-
localScoreDiff
public double localScoreDiff(int x, int y, int[] z) Returns the different between localScore(y | z, x) and localScore(y | z)- Specified by:
localScoreDiffin interfaceScore- Parameters:
x- The index of the x variabley- The index of the y variable.z- The indices of the z variables- Returns:
- The differnece in scores.
-
getDataSet
Returns the dataset being analyzed.- Specified by:
getDataSetin interfaceDiscreteScore- Returns:
- This dataset.
-
setStructurePrior
public void setStructurePrior(double structurePrior) BDe does not use a structure prior.- Specified by:
setStructurePriorin interfaceDiscreteScore- Parameters:
structurePrior- The structure prior (not used).- Throws:
UnsupportedOperationException- Since this method is not implemented for this score.
-
setSamplePrior
public void setSamplePrior(double samplePrior) BDe does not use a sample prior.- Specified by:
setSamplePriorin interfaceDiscreteScore- Parameters:
samplePrior- The structure prior (not used).- Throws:
UnsupportedOperationException- Since this method is not implemented for this score.
-
getVariables
Returns the variables of the dataset.- Specified by:
getVariablesin interfaceScore- Returns:
- These variables as list.
-
getSampleSize
public int getSampleSize()Returns the sample size of the data.- Specified by:
getSampleSizein interfaceScore- Returns:
- This size.
-
isEffectEdge
public boolean isEffectEdge(double bump) Returns a judgment of whether the given bump in score allows one to conclude that the edge is an "effect edge" for FGES.- Specified by:
isEffectEdgein interfaceScore- Parameters:
bump- The bump.- Returns:
- True iff so.
- See Also:
-
getMaxDegree
public int getMaxDegree()Returns the maximum degree of the graphs as they're searched.- Specified by:
getMaxDegreein interfaceScore- Returns:
- This maximum degree.
-
toString
Returns "BDe Score".
-