Package edu.cmu.tetrad.search.score
Class GicScores
java.lang.Object
edu.cmu.tetrad.search.score.GicScores
- All Implemented Interfaces:
Score
Implements scores motivated by the Generalized Information Criterion (GIC) approach as given in Kim et al. (2012).
Kim, Y., Kwon, S., & Choi, H. (2012). Consistent model selection criteria on high dimensions. The Journal of Machine Learning Research, 13(1), 1037-1057.
As for all scores in Tetrad, higher scores mean more dependence, and negative scores indicate independence.
- Version:
- $Id: $Id
- Author:
- josephramsey
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Gives the options for the rules to use for calculating the scores. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs the score using a covariance matrix.GicScores
(ICovarianceMatrix covariances) Constructs the score using a covariance matrix. -
Method Summary
Modifier and TypeMethodDescriptionboolean
determines
(List<Node> z, Node y) Returns true iff the score determines the edge between x and y.Returns the sample size.Returns the dataset.int
Returns the max degree, by default 1000.double
Returns the penalty discount.int
Returns the sample size.The variables of the score.boolean
isEffectEdge
(double bump) Returns true iff the edge between x and y is an effect edge.boolean
Returns true if verbose output should be sent to out.double
localScore
(int i, int... parents) Calculates the sample likelihood and BIC score for index i given its parents in a simple SEM model.double
localScoreDiff
(int x, int y, int[] z) Returns the score difference of the graph.void
setLambda
(double lambda) Sets the lambda parameter.void
setPenaltyDiscount
(double penaltyDiscount) Sets the penalty discount.void
setRuleType
(GicScores.RuleType ruleType) Sets the rule type.void
setUsePseudoInverse
(boolean usePseudoInverse) Sets whether to use the pseudo-inverse when calculating the score.void
setVariables
(List<Node> variables) Sets the variables of the dataset.void
setVerbose
(boolean verbose) Sets whether verbose output should be sent to out.toString()
Returns a string for this object.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface edu.cmu.tetrad.search.score.Score
append, getVariable, localScore, localScore, localScoreDiff
-
Constructor Details
-
GicScores
Constructs the score using a covariance matrix.- Parameters:
covariances
- The covariance matrix.
-
GicScores
Constructs the score using a covariance matrix.- Parameters:
dataSet
- The continuous dataset to analyze.precomputeCovariances
- Whether the covariances should be precomputed or computed on the fly. True if
-
-
Method Details
-
localScoreDiff
public double localScoreDiff(int x, int y, int[] z) Returns the score difference of the graph.Calculates the sample likelihood and BIC score for index i given its parents in a simple SEM model.
- Specified by:
localScoreDiff
in interfaceScore
- Parameters:
x
- A node.y
- TAhe node.z
- A set of nodes.- Returns:
- The score difference.
-
localScore
public 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:
localScore
in interfaceScore
- Parameters:
i
- The node.parents
- The parents.- Returns:
- The score.
-
getCovariances
-
getSampleSize
public int getSampleSize()Returns the sample size.- Specified by:
getSampleSize
in interfaceScore
- Returns:
- This size.
-
isEffectEdge
public boolean isEffectEdge(double bump) Returns true iff the edge between x and y is an effect edge.Returns true if an edge with this bump 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.
-
getDataSet
-
isVerbose
public boolean isVerbose()Returns true if verbose output should be sent to out.- Returns:
- True if verbose output should be sent to out.
-
setVerbose
public void setVerbose(boolean verbose) Sets whether verbose output should be sent to out.- Parameters:
verbose
- True if verbose output should be sent to out.
-
getVariables
The variables of the score.Returns the variables of the dataset.
- Specified by:
getVariables
in interfaceScore
- Returns:
- This list.
-
setVariables
-
getMaxDegree
public int getMaxDegree()Returns the max degree, by default 1000.Returns the max degree of the graph for some algorithms.
- Specified by:
getMaxDegree
in interfaceScore
- Returns:
- The max degree.
-
determines
Returns true iff the score determines the edge between x and y.Returns a judgment of whether the variable in z determine y exactly.
- 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.
-
setRuleType
Sets the rule type.- Parameters:
ruleType
- The rule type.- See Also:
-
setLambda
public void setLambda(double lambda) Sets the lambda parameter.- Parameters:
lambda
- The lambda parameter.
-
getPenaltyDiscount
public double getPenaltyDiscount()Returns the penalty discount.- Returns:
- The penalty discount.
-
setPenaltyDiscount
public void setPenaltyDiscount(double penaltyDiscount) Sets the penalty discount.- Parameters:
penaltyDiscount
- The penalty discount.
-
toString
-
setUsePseudoInverse
public void setUsePseudoInverse(boolean usePseudoInverse) Sets whether to use the pseudo-inverse when calculating the score.- Parameters:
usePseudoInverse
- True if so.
-