Package edu.cmu.tetrad.search
Class ZhangShenBoundTest
java.lang.Object
edu.cmu.tetrad.search.ZhangShenBoundTest
- All Implemented Interfaces:
Score
Implements the continuous BIC score for FGES.
- Author:
- Joseph Ramsey
-
Constructor Summary
ConstructorsConstructorDescriptionZhangShenBoundTest(DataSet dataSet) Constructs the score using a covariance matrix.ZhangShenBoundTest(ICovarianceMatrix covariances) Constructs the score using a covariance matrix. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull Matrixbooleandetermines(List<Node> z, Node y) intstatic doublegetP(int pn, int m0, double lambda) doubleintgetVariable(String targetName) static doublegetVarRy(int i, int[] parents, Matrix data, ICovarianceMatrix covariances, boolean calculateRowSubsets, boolean calculateSquareEuclideanNorms) booleanbooleanisEffectEdge(double bump) booleandoublelocalScore(int i) Specialized scoring method for no parents.doublelocalScore(int i, int parent) Specialized scoring method for a single parent.doublelocalScore(int i, int... parents) doublelocalScoreDiff(int x, int y) doublelocalScoreDiff(int x, int y, int[] z) voidsetCalculateSquaredEuclideanNorms(boolean calculateSquaredEuclideanNorms) voidsetChanged(boolean b) voidsetCorrelationThreshold(double correlationThreshold) voidsetPenaltyDiscount(double penaltyDiscount) voidsetRiskBound(double riskBound) voidsetTakeLog(boolean takeLog) voidsetTrueErrorVariance(double trueErrorVariance) voidsetVerbose(boolean verbose) static doublezhangShenLambda(int pn, int m0, double riskBound) 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
defaultScore, toString
-
Constructor Details
-
ZhangShenBoundTest
Constructs the score using a covariance matrix. -
ZhangShenBoundTest
Constructs the score using a covariance matrix.
-
-
Method Details
-
localScoreDiff
public double localScoreDiff(int x, int y, int[] z) - Specified by:
localScoreDiffin interfaceScore
-
localScoreDiff
public double localScoreDiff(int x, int y) - Specified by:
localScoreDiffin interfaceScore
-
localScore
- 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.
- Throws:
RuntimeException
-
getVarRy
public static double getVarRy(int i, int[] parents, Matrix data, ICovarianceMatrix covariances, boolean calculateRowSubsets, boolean calculateSquareEuclideanNorms) -
zhangShenLambda
public static double zhangShenLambda(int pn, int m0, double riskBound) -
getP
public static double getP(int pn, int m0, double lambda) -
bStar
-
localScore
public double localScore(int i, int parent) Specialized scoring method for a single parent. Used to speed up the effect edges search.- Specified by:
localScorein interfaceScore
-
localScore
public double localScore(int i) Specialized scoring method for no parents. Used to speed up the effect edges search.- Specified by:
localScorein interfaceScore
-
getCovariances
-
getSampleSize
public int getSampleSize()- Specified by:
getSampleSizein interfaceScore
-
isEffectEdge
public boolean isEffectEdge(double bump) - Specified by:
isEffectEdgein interfaceScore
-
isVerbose
public boolean isVerbose() -
setVerbose
public void setVerbose(boolean verbose) -
getVariables
- Specified by:
getVariablesin interfaceScore
-
getVariable
- Specified by:
getVariablein interfaceScore
-
getMaxDegree
public int getMaxDegree()- Specified by:
getMaxDegreein interfaceScore
-
determines
- Specified by:
determinesin interfaceScore
-
setCalculateSquaredEuclideanNorms
public void setCalculateSquaredEuclideanNorms(boolean calculateSquaredEuclideanNorms) -
isChanged
public boolean isChanged() -
setChanged
public void setChanged(boolean b) -
setPenaltyDiscount
public void setPenaltyDiscount(double penaltyDiscount) -
getPenaltyDiscount
public double getPenaltyDiscount() -
setRiskBound
public void setRiskBound(double riskBound) -
setCorrelationThreshold
public void setCorrelationThreshold(double correlationThreshold) -
setTakeLog
public void setTakeLog(boolean takeLog) -
setTrueErrorVariance
public void setTrueErrorVariance(double trueErrorVariance)
-