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 enumGives 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 TypeMethodDescriptionbooleandetermines(List<Node> z, Node y) Returns true iff the score determines the edge between x and y.Returns the sample size.Returns the dataset.intReturns the max degree, by default 1000.doubleReturns the penalty discount.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.booleanReturns true if verbose output should be sent to out.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) Returns the score difference of the graph.voidsetLambda(double lambda) Sets the lambda parameter.voidsetPenaltyDiscount(double penaltyDiscount) Sets the penalty discount.voidsetRuleType(GicScores.RuleType ruleType) Sets the rule type.voidsetUsePseudoInverse(boolean usePseudoInverse) Sets whether to use the pseudo-inverse when calculating the score.voidsetVariables(List<Node> variables) Sets the variables of the dataset.voidsetVerbose(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, waitMethods 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:
localScoreDiffin 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:
localScorein interfaceScore- Parameters:
i- The node.parents- The parents.- Returns:
- The score.
-
getCovariances
Returns the sample size.- Returns:
- This size.
-
getSampleSize
public int getSampleSize()Returns the sample size.- Specified by:
getSampleSizein 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:
isEffectEdgein interfaceScore- Parameters:
bump- The bump.- Returns:
- True iff the edge between x and y is an effect edge.
-
getDataSet
Returns the dataset.- Returns:
- The dataset.
-
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:
getVariablesin interfaceScore- Returns:
- This list.
-
setVariables
Sets the variables of the dataset.- Parameters:
variables- The variables of the dataset.
-
getMaxDegree
public int getMaxDegree()Returns the max degree, by default 1000.Returns the max degree of the graph for some algorithms.
- Specified by:
getMaxDegreein 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:
determinesin 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
Returns a string for this object. -
setUsePseudoInverse
public void setUsePseudoInverse(boolean usePseudoInverse) Sets whether to use the pseudo-inverse when calculating the score.- Parameters:
usePseudoInverse- True if so.
-