Class SemBicScore
- All Implemented Interfaces:
Score
Implements the linear, Gaussian BIC score, with a 'penalty discount' multiplier on the BIC penalty. The formula used for the score is BIC = 2L - ck ln n, where c is the penalty discount and L is the linear, Gaussian log likelihood--that is, the sum of the log likelihoods of the individual records, which are assumed to be i.i.d.
For FGES, Chickering uses the standard linear, Gaussian BIC score, so we will for lack of a better reference give his paper:
Chickering (2002) "Optimal structure identification with greedy search" Journal of Machine Learning Research.
The version of the score due to Nandy et al. is given in this reference:
Nandy, P., Hauser, A., invalid input: '&' Maathuis, M. H. (2018). High-dimensional consistency in score-based and hybrid structure learning. The Annals of Statistics, 46(6A), 3151-3183.
This score may be used anywhere though where a linear, Gaussian score is needed. Anectodally, the score is fairly robust to non-Gaussianity, though with some additional unfaithfulness over and above waht the score would give for Guassian data, a detriment that can be overcome to an extent by use a permutation algorithm such as SP, GRaSP, or BOSS
As for all scores in Tetrad, higher scores mean more dependence, and negative scores indicate independence.
- Author:
- josephramsey
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumGives two options for calculating the BIC score, one describe by Chickering and the other due to Nandy et al. -
Constructor Summary
ConstructorsConstructorDescriptionSemBicScore(DataSet dataSet) Constructs the score using a covariance matrix.SemBicScore(ICovarianceMatrix covariances) Constructs the score using a covariance matrix. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull Matrixbooleandetermines(List<Node> z, Node y) getData()intdoubleSpecialized scoring method for a single parent.intThe sample size of the data.doubleThe variables of the score.static doublegetVarRy(int i, int[] parents, Matrix data, ICovarianceMatrix covariances, boolean calculateRowSubsets) booleanisEffectEdge(double bump) booleandoublelocalScore(int i, int... parents) The score of a node given its parents.doublelocalScoreDiff(int x, int y, int[] z) doublenandyBic(int x, int y, int[] z) voidsetPenaltyDiscount(double penaltyDiscount) voidsetRuleType(SemBicScore.RuleType ruleType) voidsetStructurePrior(double structurePrior) voidsetVariables(List<Node> variables) voidsetVerbose(boolean verbose) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface edu.cmu.tetrad.search.score.Score
append, getVariable, localScore, localScore, localScoreDiff, toString
-
Constructor Details
-
SemBicScore
Constructs the score using a covariance matrix. -
SemBicScore
Constructs the score using a covariance matrix.
-
-
Method Details
-
getVarRy
public static double getVarRy(int i, int[] parents, Matrix data, ICovarianceMatrix covariances, boolean calculateRowSubsets) throws org.apache.commons.math3.linear.SingularMatrixException - Throws:
org.apache.commons.math3.linear.SingularMatrixException
-
bStar
-
localScoreDiff
public double localScoreDiff(int x, int y, int[] z) - Specified by:
localScoreDiffin interfaceScore
-
nandyBic
public double nandyBic(int x, int y, int[] z) -
localScore
public double localScore(int i, int... parents) Description copied from interface:ScoreThe score of a node given its parents.- Specified by:
localScorein interfaceScore- Parameters:
i- The index of the node.parents- The indices of the node's parents.- Returns:
- The score, or NaN if the score cannot be calculated.
-
getPenaltyDiscount
public double getPenaltyDiscount()Specialized scoring method for a single parent. Used to speed up the effect edges search. -
setPenaltyDiscount
public void setPenaltyDiscount(double penaltyDiscount) -
getStructurePrior
public double getStructurePrior() -
setStructurePrior
public void setStructurePrior(double structurePrior) -
getCovariances
-
getSampleSize
public int getSampleSize()Description copied from interface:ScoreThe sample size of the data.- Specified by:
getSampleSizein interfaceScore- Returns:
- This size.
-
isEffectEdge
public boolean isEffectEdge(double bump) - Specified by:
isEffectEdgein interfaceScore
-
getDataModel
-
isVerbose
public boolean isVerbose() -
setVerbose
public void setVerbose(boolean verbose) -
getVariables
Description copied from interface:ScoreThe variables of the score.- Specified by:
getVariablesin interfaceScore- Returns:
- This list.
-
setVariables
-
getMaxDegree
public int getMaxDegree()- Specified by:
getMaxDegreein interfaceScore
-
determines
- Specified by:
determinesin interfaceScore
-
getData
-
setRuleType
-
subset
-