Package edu.cmu.tetrad.search.score
Class ConditionalGaussianScore
java.lang.Object
edu.cmu.tetrad.search.score.ConditionalGaussianScore
- All Implemented Interfaces:
- Score
Implements a conditional Gaussian BIC score for FGS, which calculates a BIC score for mixed discrete/Gaussian data
 using the conditional Gaussian likelihood function (see). The reference is here:
 
Andrews, B., Ramsey, J., & Cooper, G. F. (2018). Scoring Bayesian networks of mixed variables. International journal of data science and analytics, 6, 3-18.
As for all scores in Tetrad, higher scores mean more dependence, and negative scores indicate independence.
- Version:
- $Id: $Id
- Author:
- josephramsey
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionConditionalGaussianScore(DataSet dataSet, double penaltyDiscount, boolean discretize) Constructs the score using a covariance matrix.
- 
Method SummaryModifier and TypeMethodDescriptionintReturns the max degree, by default 1000.doubleReturns the penalty discount for this score, which is a multiplier on the penalty term of the BIC score.intReturns the sample size of the data.The variables of the score.booleanisEffectEdge(double bump) Returns true iff the edge between x and y is an effect edge.doublelocalScore(int i, int... parents) Calculates the sample likelihood and BIC score for index i given its parents in a simple SEM model.doublelocalScoreDiff(int x, int y, int[] z) Calculates localScore(y | z, x) - localScore(z).voidsetNumCategoriesToDiscretize(int numCategoriesToDiscretize) Sets tne number of categories used to discretize, when this optimization is used.voidsetPenaltyDiscount(double penaltyDiscount) Sets the penalty discount for this score, which is a multiplier on the penalty discount of the BIC score.voidsetStructurePrior(double structurePrior) Setter for the fieldstructurePrior.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- 
ConditionalGaussianScoreConstructs the score using a covariance matrix.- Parameters:
- dataSet- A dataset with a mixture of continuous and discrete variables. It may be all continuous or all discrete.
- penaltyDiscount- A multiplier on the penalty term in the BIC score.
- discretize- When a discrete variable is a child of a continuous variable, one (expensive) way to solve the problem is to do a numerical integration. A less expensive (and often more accurate) way to solve the problem is to discretize the child with a certain number of discrete categories. if this parameter is set to True, a separate copy of all variables is maintained that is discretized in this way, and these are substituted for the discrete children when this sort of problem needs to be solved. This information needs to be known in the constructor since one needs to know right away whether ot create this separate discretized version of the continuous columns.
- See Also:
 
 
- 
- 
Method Details- 
localScorepublic double localScore(int i, int... parents) Calculates the sample likelihood and BIC score for index i given its parents in a simple SEM model.- Specified by:
- localScorein interface- Score
- Parameters:
- i- The index of the child.
- parents- The indices of the parents.
- Returns:
- The score.,
 
- 
localScoreDiffpublic double localScoreDiff(int x, int y, int[] z) Calculates localScore(y | z, x) - localScore(z).- Specified by:
- localScoreDiffin interface- Score
- Parameters:
- x- The index of the child.
- y- a int
- z- The indices of the parents.
- Returns:
- The score difference.
 
- 
getSampleSizepublic int getSampleSize()Returns the sample size of the data.- 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.A method for FGES for determining whether an edge counts as an effect edges for this score bump. - Specified by:
- isEffectEdgein interface- Score
- Parameters:
- bump- The bump.
- Returns:
- True iff the edge between x and y is an effect edge.
- See Also:
 
- 
getVariablesThe variables of the score.Returns the variables of the data. - Specified by:
- getVariablesin interface- Score
- Returns:
- This list.
 
- 
getMaxDegreepublic int getMaxDegree()Returns the max degree, by default 1000.Returns the max degree recommended for the search form the MagSemBicScore and Fges. - Specified by:
- getMaxDegreein interface- Score
- Returns:
- The max degree.
- See Also:
 
- 
getPenaltyDiscountpublic double getPenaltyDiscount()Returns the penalty discount for this score, which is a multiplier on the penalty term of the BIC score.- Returns:
- This penalty discount.
 
- 
setPenaltyDiscountpublic void setPenaltyDiscount(double penaltyDiscount) Sets the penalty discount for this score, which is a multiplier on the penalty discount of the BIC score.- Parameters:
- penaltyDiscount- This penalty discount.
 
- 
setNumCategoriesToDiscretizepublic void setNumCategoriesToDiscretize(int numCategoriesToDiscretize) Sets tne number of categories used to discretize, when this optimization is used.- Parameters:
- numCategoriesToDiscretize- This number.
 
- 
toStringA string representation of the score.
- 
setStructurePriorpublic void setStructurePrior(double structurePrior) Setter for the field structurePrior.- Parameters:
- structurePrior- a double
 
 
-