Package edu.cmu.tetrad.search.score
Class DiscreteBicScoreAdTree
java.lang.Object
edu.cmu.tetrad.search.score.DiscreteBicScoreAdTree
- All Implemented Interfaces:
- DiscreteScore,- Score
Calculates the discrete BIC score. The likelihood for this score is calculated as SUM(ln(P(X | Z) P(Z))) across all
 cells in all conditional probability tables for the discrete model. The parameters are counted as SUM(rows * (cols -
 1)) for all conditional probability tables in the model, where rows summing to zero are discounted, as their marginal
 probabilities cannot be calcualted. Then the BIC score is calculated as 2L - ck ln N, where c is a multiplier on the
 penalty ("penalty discount").
 
As for all scores in Tetrad, higher scores mean more dependence, and negative scores indicate independence.
- Version:
- $Id: $Id
- Author:
- josephramsey
- 
Constructor SummaryConstructorsConstructorDescriptionDiscreteBicScoreAdTree(DataSet dataSet) Constructs the score using a dataset.
- 
Method SummaryModifier and TypeMethodDescriptionReturns the dataset.intReturns the max degree, by default 1000.int[]getParentValues(int[] parents, int rowIndex) Returns an integer array containing the parent values for a given node index and row index.intReturns the sample size.The variables of the score.booleanisEffectEdge(double bump) Returns true iff the edge between x and y is an effect edge.doublelocalScore(int node, int[] parents) The score of a node given its parents.doublelocalScoreDiff(int x, int y, int[] z) Returns the score difference of the graph.voidsetPenaltyDiscount(double penaltyDiscount) Sets the penalty discount, which is a multiplier on the penalty term of BIC.voidsetSamplePrior(double samplePrior) Sets the sample prior.voidsetStructurePrior(double structurePrior) Sets the structure prior.voidsetVariables(List<Node> variables) Sets the variables to a new list of the same size.toString()A string representation of the score.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- 
DiscreteBicScoreAdTreeConstructs the score using a dataset.- Parameters:
- dataSet- The discrete dataset to analyze.
 
 
- 
- 
Method Details- 
localScorepublic double localScore(int node, int[] parents) The score of a node given its parents.Returns the score of the given nodes given its parents. - Specified by:
- localScorein interface- Score
- Parameters:
- node- The node.
- parents- The parents.
- Returns:
- The score.
 
- 
localScoreDiffpublic double localScoreDiff(int x, int y, int[] z) Returns the score difference of the graph.Returns localScore(y | z, x) - localScore(y | z). - Specified by:
- localScoreDiffin interface- Score
- Parameters:
- x- A node.
- y- TAhe node.
- z- A set of nodes.
- Returns:
- The score difference.
 
- 
getVariablesThe variables of the score.Returns the variables. - Specified by:
- getVariablesin interface- Score
- Returns:
- This list.
 
- 
setVariablesSets the variables to a new list of the same size.- Parameters:
- variables- The new list of variables.
 
- 
getSampleSizepublic int getSampleSize()Returns the sample size.- Specified by:
- getSampleSizein interface- Score
- Returns:
- This size.
 
- 
isEffectEdgepublic boolean isEffectEdge(double bump) Returns true iff the edge between x and y is an effect edge.Must be called directly after the corresponding scoring call. Used in FGES. - Specified by:
- isEffectEdgein interface- Score
- Parameters:
- bump- The bump.
- Returns:
- True iff the edge between x and y is an effect edge.
- See Also:
 
- 
getDataSetReturns the dataset.Returns the dataset being analyzed. - Specified by:
- getDataSetin interface- DiscreteScore
- Returns:
- Ibid.
 
- 
setStructurePriorpublic void setStructurePrior(double structurePrior) Sets the structure prior.Sets the structure prior. - Specified by:
- setStructurePriorin interface- DiscreteScore
- Parameters:
- structurePrior- Ibid.
 
- 
setSamplePriorpublic void setSamplePrior(double samplePrior) Sets the sample prior.This method is not used for this score. - Specified by:
- setSamplePriorin interface- DiscreteScore
- Parameters:
- samplePrior- Ibid.
 
- 
setPenaltyDiscountpublic void setPenaltyDiscount(double penaltyDiscount) Sets the penalty discount, which is a multiplier on the penalty term of BIC.- Parameters:
- penaltyDiscount- This discount.
 
- 
getMaxDegreepublic int getMaxDegree()Returns the max degree, by default 1000.Returns the maximum degree for some algorithms. - Specified by:
- getMaxDegreein interface- Score
- Returns:
- The max degree.
 
- 
toStringA string representation of the score.Returns a string representation of this score. 
- 
getParentValuespublic int[] getParentValues(int[] parents, int rowIndex) Returns an integer array containing the parent values for a given node index and row index.- Parameters:
- parents- the indices of the parent nodes.
- rowIndex- the index of the row in question.
- Returns:
- an integer array containing the parent values.
 
 
-