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., & 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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Gives two options for calculating the BIC score, one describe by Chickering and the other due to Nandy et al. -
Constructor Summary
ConstructorsConstructorDescriptionSemBicScore
(DataSet dataSet, boolean precomputeCovariances) Constructs the score using a covariance matrix.SemBicScore
(ICovarianceMatrix covariances) Constructs the score using a covariance matrix. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull Matrix
boolean
determines
(List<Node> z, Node y) Returns true iff the score determines the edge between x and y.getData()
int
Returns the max degree, by default 1000.double
Specialized scoring method for a single parent.int
The sample size of the data.double
The variables of the score.static double
getVarRy
(int i, int[] parents, Matrix data, ICovarianceMatrix covariances, boolean calculateRowSubsets) boolean
isEffectEdge
(double bump) Returns true iff the edge between x and y is an effect edge.boolean
double
localScore
(int i, int... parents) The score of a node given its parents.double
localScoreDiff
(int x, int y, int[] z) Returns the score difference of the graph.double
nandyBic
(int x, int y, int[] z) void
setPenaltyDiscount
(double penaltyDiscount) void
setRuleType
(SemBicScore.RuleType ruleType) void
setStructurePrior
(double structurePrior) void
setVariables
(List<Node> variables) void
setVerbose
(boolean verbose) toString()
A string representation of the score.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface edu.cmu.tetrad.search.score.Score
append, getVariable, localScore, localScore, localScoreDiff
-
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) Description copied from interface:Score
Returns the score difference of the graph.- Specified by:
localScoreDiff
in interfaceScore
- Parameters:
x
- A node.y
- TAhe node.z
- A set of nodes.- Returns:
- The score difference.
-
nandyBic
public double nandyBic(int x, int y, int[] z) -
localScore
public double localScore(int i, int... parents) Description copied from interface:Score
The score of a node given its parents.- Specified by:
localScore
in 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:Score
The sample size of the data.- Specified by:
getSampleSize
in interfaceScore
- Returns:
- This size.
-
isEffectEdge
public boolean isEffectEdge(double bump) Description copied from interface:Score
Returns true iff the edge between x and y is an effect edge.- Specified by:
isEffectEdge
in interfaceScore
- Parameters:
bump
- The bump.- Returns:
- True iff the edge between x and y is an effect edge.
-
getDataModel
-
isVerbose
public boolean isVerbose() -
setVerbose
public void setVerbose(boolean verbose) -
getVariables
Description copied from interface:Score
The variables of the score.- Specified by:
getVariables
in interfaceScore
- Returns:
- This list.
-
setVariables
-
getMaxDegree
public int getMaxDegree()Description copied from interface:Score
Returns the max degree, by default 1000.- Specified by:
getMaxDegree
in interfaceScore
- Returns:
- The max degree.
-
determines
Description copied from interface:Score
Returns true iff the score determines the edge between x and y.- Specified by:
determines
in interfaceScore
- Parameters:
z
- The set of nodes.y
- The node.- Returns:
- True iff the score determines the edge between x and y.
-
getData
-
setRuleType
-
subset
-
toString
Description copied from interface:Score
A string representation of the score.
-