Package edu.cmu.tetrad.search.score
Class BasisFunctionBicScoreFullSample
java.lang.Object
edu.cmu.tetrad.search.score.BasisFunctionBicScoreFullSample
- All Implemented Interfaces:
- Score
Calculates the basis function BIC score for a given dataset. This is a generalization 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.
 
This version uses a tabular approach to calculate the score rather than using covariance matrices.
- Author:
- josephramsey, bryanandrews
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionBasisFunctionBicScoreFullSample(DataSet dataSet, int truncationLimit, double lambda) Constructs a BasisFunctionBicScore object with the specified parameters.
- 
Method SummaryModifier and TypeMethodDescriptionstatic org.ejml.simple.SimpleMatrixcomputeOLS(org.ejml.simple.SimpleMatrix B, org.ejml.simple.SimpleMatrix X, double lambda) Computes the Ordinary Least Squares (OLS) regression coefficients with L2 regularization.intRetrieves the maximum degree from the underlying BIC score component.intRetrieves the sample size from the underlying BIC score component.Retrieves the list of nodes representing the variables in the basis function score.booleanisEffectEdge(double bump) Determines if the given bump value represents an effect edge.doublelocalScore(int i, int... parents) Calculates the local score for a given node and its parent nodes.doublelocalScoreDiff(int x, int y, int[] z) Returns the score difference of the graph.voidsetDoOneEquationOnly(boolean doOneEquationOnly) When calculation the score for X = <X1 = X, X2, X3,..., Xp> use the equation for X1 only, if true; otherwise, use equations for all of X1, X2,...,Xp.voidsetPenaltyDiscount(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.Objectequals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface edu.cmu.tetrad.search.score.Scoreappend, determines, getVariable, localScore, localScore, localScoreDiff
- 
Constructor Details- 
BasisFunctionBicScoreFullSampleConstructs a BasisFunctionBicScore object with the specified parameters.- Parameters:
- dataSet- the data set on which the score is to be calculated. May contain a mixture of discrete and continuous variables.
- truncationLimit- the truncation limit of the basis.
- lambda- Singularity lambda
- See Also:
 
 
- 
- 
Method Details- 
computeOLSpublic static org.ejml.simple.SimpleMatrix computeOLS(org.ejml.simple.SimpleMatrix B, org.ejml.simple.SimpleMatrix X, double lambda) Computes the Ordinary Least Squares (OLS) regression coefficients with L2 regularization.- Parameters:
- B- The design matrix where each row represents a sample and each column represents a feature.
- X- The matrix containing the target values for corresponding samples.
- lambda- The regularization parameter to control overfitting (L2 regularization).
- Returns:
- A matrix representing the OLS regression coefficients.
 
- 
localScorepublic double localScore(int i, int... parents) Calculates the local score for a given node and its parent nodes.- Specified by:
- localScorein interface- Score
- 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.
 
- 
localScoreDiffpublic double localScoreDiff(int x, int y, int[] z) Description copied from interface:ScoreReturns the score difference of the graph.- Specified by:
- localScoreDiffin interface- Score
- Parameters:
- x- A node.
- y- TAhe node.
- z- A set of nodes.
- Returns:
- The score difference.
 
- 
getVariablesRetrieves the list of nodes representing the variables in the basis function score.- Specified by:
- getVariablesin interface- Score
- Returns:
- a list containing the nodes that represent the variables in the basis function score.
 
- 
isEffectEdgepublic boolean isEffectEdge(double bump) Determines if the given bump value represents an effect edge.- Specified by:
- isEffectEdgein interface- Score
- Parameters:
- bump- the bump value to be evaluated.
- Returns:
- true if the bump is an effect edge, false otherwise.
 
- 
getSampleSizepublic int getSampleSize()Retrieves the sample size from the underlying BIC score component.- Specified by:
- getSampleSizein interface- Score
- Returns:
- the sample size as an integer
 
- 
getMaxDegreepublic int getMaxDegree()Retrieves the maximum degree from the underlying BIC score component.- Specified by:
- getMaxDegreein interface- Score
- Returns:
- the maximum degree as an integer.
 
- 
toStringReturns a string representation of the BasisFunctionBicScore object.
- 
setPenaltyDiscountpublic 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.
 
- 
setDoOneEquationOnlypublic void setDoOneEquationOnly(boolean doOneEquationOnly) When calculation the score for X = <X1 = X, X2, X3,..., Xp> use the equation for X1 only, if true; otherwise, use equations for all of X1, X2,...,Xp.- Parameters:
- doOneEquationOnly- True if only the equation for X1 is to be used for X = X1,...,Xp. *
 
 
-