Package edu.cmu.tetrad.search.score
Class DegenerateGaussianScore
java.lang.Object
edu.cmu.tetrad.search.score.DegenerateGaussianScore
- All Implemented Interfaces:
Score
=This implements the degenerate Gaussian BIC score for FGES. The degenerate Gaussian score replaces each discrete
variable in the data with a list of 0/1 continuous indicator columns for each of the categories but one (the last one
implied). This data, now all continuous, is given to the SEM BIC score and methods used to help determine conditional
independence for the mixed continuous/discrete case from this information. The reference is as follows:
Andrews, B., Ramsey, J., & Cooper, G. F. (2019, July). Learning high-dimensional directed acyclic graphs with mixed data-types. In The 2019 ACM SIGKDD Workshop on Causal Discovery (pp. 4-21). PMLR.
As for all scores in Tetrad, higher scores mean more dependence, and negative scores indicate independence.
- Version:
- $Id: $Id
- Author:
- Bryan Andrews
-
Constructor Summary
ConstructorsConstructorDescriptionDegenerateGaussianScore
(DataSet dataSet, boolean precomputeCovariances) Constructs the score using a dataset. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the max degree, by default 1000.double
Returns the penalty discount.int
The sample size of the data.The variables of the score.boolean
isEffectEdge
(double bump) Returns true iff the edge between x and y is an effect edge.double
localScore
(int i, int... parents) Calculates the sample likelihood and BIC score for i given its parents in a simple SEM model.double
localScoreDiff
(int x, int y, int[] z) Calculates localScore(y | z, x) - localScore(z).void
setPenaltyDiscount
(double penaltyDiscount) Sets the penalty discount.void
setUsePseudoInverse
(boolean usePseudoInverse) Sets the flag to indicate whether to use pseudo inverse in the score calculations.toString()
A string representation of the score.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, determines, getVariable, localScore, localScore, localScoreDiff
-
Constructor Details
-
DegenerateGaussianScore
Constructs the score using a dataset.- Parameters:
dataSet
- The dataset.precomputeCovariances
- True if covariances should be precomputed.
-
-
Method Details
-
localScore
public double localScore(int i, int... parents) Calculates the sample likelihood and BIC score for i given its parents in a simple SEM model.- Specified by:
localScore
in interfaceScore
- Parameters:
i
- The child indes.parents
- The indices of the parents.- Returns:
- a double
-
localScoreDiff
public double localScoreDiff(int x, int y, int[] z) Calculates localScore(y | z, x) - localScore(z).- Specified by:
localScoreDiff
in interfaceScore
- Parameters:
x
- A node.y
- TAhe node.z
- A set of nodes.- Returns:
- The score difference.
-
getVariables
The variables of the score.Returns the list of variables.
- Specified by:
getVariables
in interfaceScore
- Returns:
- This list.
-
isEffectEdge
public boolean isEffectEdge(double bump) Returns true iff the edge between x and y is an effect edge.True if an edge with the given 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.
-
getSampleSize
public int getSampleSize()The sample size of the data.Returns the sample sizE.
- Specified by:
getSampleSize
in interfaceScore
- Returns:
- This size.
-
getMaxDegree
public int getMaxDegree()Returns the max degree, by default 1000.Returns the max degree.
- Specified by:
getMaxDegree
in interfaceScore
- Returns:
- The max degree.
-
toString
-
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.
-
setUsePseudoInverse
public void setUsePseudoInverse(boolean usePseudoInverse) Sets the flag to indicate whether to use pseudo inverse in the score calculations.- Parameters:
usePseudoInverse
- True if pseudo inverse should be used, false otherwise.
-