Package edu.cmu.tetrad.search.score
Class BasisFunctionBicScore
java.lang.Object
edu.cmu.tetrad.search.score.BasisFunctionBicScore
- All Implemented Interfaces:
Score
Calculates the basis function BIC score for a given dataset. This is a modification of the Degenerate Gaussian score
by adding basis functions of the continuous variables and retains the function of the degenerate Gaussian for
discrete variables by adding indicator variables per category.
- Author:
- bandrews, josephramsey
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBasisFunctionBicScore
(DataSet dataSet, boolean precomputeCovariances, int truncationLimit, int basisType, double basisScale) Constructs a BasisFunctionBicScore object with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionint
Retrieves the maximum degree from the underlying BIC score component.int
Retrieves the sample size from the underlying BIC score component.Retrieves the list of nodes representing the variables in the basis function score.boolean
isEffectEdge
(double bump) Determines if the given bump value represents an effect edge.double
localScore
(int i, int... parents) Calculates the local score for a given node and its parent nodes.double
localScoreDiff
(int x, int y, int[] z) Returns the score difference of the graph.void
setPenaltyDiscount
(double penaltyDiscount) Sets the penalty discount value, which is used to adjust the penalty term in the BIC score calculation.toString()
Returns a string representation of the BasisFunctionBicScore 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, determines, getVariable, localScore, localScore, localScoreDiff
-
Constructor Details
-
BasisFunctionBicScore
public BasisFunctionBicScore(DataSet dataSet, boolean precomputeCovariances, int truncationLimit, int basisType, double basisScale) Constructs a BasisFunctionBicScore object with the specified parameters.- Parameters:
dataSet
- the data set on which the score is to be calculated.precomputeCovariances
- flag indicating whether covariances should be precomputed.truncationLimit
- the truncation limit of the basis.basisType
- the type of basis function used in the BIC score computation.basisScale
- the basisScale factor used in the calculation of the BIC score for basis functions. All variables are scaled to [-basisScale, basisScale], or standardized if 0.- See Also:
-
-
Method Details
-
localScore
public double localScore(int i, int... parents) Calculates the local score for a given node and its parent nodes.- Specified by:
localScore
in interfaceScore
- Parameters:
i
- The index of the node whose score is being calculated.parents
- The indices for the parent nodes of the given node.- Returns:
- The calculated local score as a double value.
-
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.
-
getVariables
Retrieves the list of nodes representing the variables in the basis function score.- Specified by:
getVariables
in interfaceScore
- Returns:
- a list containing the nodes that represent the variables in the basis function score.
-
isEffectEdge
public boolean isEffectEdge(double bump) Determines if the given bump value represents an effect edge.- Specified by:
isEffectEdge
in interfaceScore
- Parameters:
bump
- the bump value to be evaluated.- Returns:
- true if the bump is an effect edge, false otherwise.
-
getSampleSize
public int getSampleSize()Retrieves the sample size from the underlying BIC score component.- Specified by:
getSampleSize
in interfaceScore
- Returns:
- the sample size as an integer
-
getMaxDegree
public int getMaxDegree()Retrieves the maximum degree from the underlying BIC score component.- Specified by:
getMaxDegree
in interfaceScore
- Returns:
- the maximum degree as an integer.
-
toString
-
setPenaltyDiscount
public void setPenaltyDiscount(double penaltyDiscount) Sets the penalty discount value, which is used to adjust the penalty term in the BIC score calculation.- Parameters:
penaltyDiscount
- The multiplier on the penalty term for this score.
-