Package edu.cmu.tetrad.search.test
Class IndTestBasisFunctionLrtFullSample
java.lang.Object
edu.cmu.tetrad.search.test.IndTestBasisFunctionLrtFullSample
- All Implemented Interfaces:
IndependenceTest,RowsSettable,EffectiveSampleSizeSettable
@Deprecated(since="7.9",
forRemoval=false)
public class IndTestBasisFunctionLrtFullSample
extends Object
implements IndependenceTest, EffectiveSampleSizeSettable, RowsSettable
Deprecated.
The IndTestBasisFunctionLrt class performs conditional independence testing using basis functions within the context
of a generalized likelihood ratio test (GLRT). This class is designed for evaluating whether two variables are
conditionally independent given a set of conditioning variables, leveraging statistical and matrix-based
computations.
This class may be compared to the covariance version (see), which is more scalable to large sample sizes. The advantage of this implementation is that rows may be subsetted randomly for individual conditional independence tests. This is not something that can be done using a covariance matrix as a sufficient statistic.
- Author:
- josephramsey, bryanandrews
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionIndTestBasisFunctionLrtFullSample(DataSet dataSet, int truncationLimit, double lambda) Deprecated.Constructs an instance of the IndTestBasisFunctionLrt class. -
Method Summary
Modifier and TypeMethodDescriptioncheckIndependence(Node x, Node y, Set<Node> z) Deprecated.Tests for the conditional independence of two nodes, x and y, given a set of conditioning nodes z.static org.ejml.simple.SimpleMatrixcomputeOLS(org.ejml.simple.SimpleMatrix B, org.ejml.simple.SimpleMatrix X, double lambda) Deprecated.Computes the Ordinary Least Squares (OLS) solution for a linear system.doublegetAlpha()Deprecated.Returns the significance level of the independence test.getData()Deprecated.Retrieves the data model associated with this instance.intDeprecated.Returns the effective sample size.getRows()Deprecated.Returns the rows used in the test.Deprecated.Retrieves the list of nodes (variables) associated with this instance.booleanDeprecated.Indicates whether verbose mode is enabled.voidsetAlpha(double alpha) Deprecated.Sets the significance level.voidsetDoOneEquationOnly(boolean doOneEquationOnly) Deprecated.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.voidsetEffectiveSampleSize(int effectiveSampleSize) Deprecated.Sets the sample size to use for the independence test, which may be different from the sample size of the data set or covariance matrix.voidsetLambda(double lambda) Deprecated.Sets the value of the lambda parameter.voidDeprecated.Allows the user to set which rows are used in the test.voidsetVerbose(boolean verbose) Deprecated.Sets the verbose mode for logging or output behavior.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface edu.cmu.tetrad.search.test.IndependenceTest
checkIndependence, determines, getCov, getDataSets, getSampleSize, getVariable, getVariableNames, indTestSubset, toString
-
Constructor Details
-
IndTestBasisFunctionLrtFullSample
Deprecated.Constructs an instance of the IndTestBasisFunctionLrt class. This constructor initializes the object using the provided dataset and configuration parameters for truncation limit, basis type, and basis scale. It processes the input dataset to create the necessary embeddings and initializes key components such as the BIC score for later use in independence testing.- Parameters:
dataSet- the input data set to be used for the analysis. It must not be null. May contain a mixture of continuous and discrete variables.truncationLimit- the maximum number of basis function truncations to be used.lambda- Regularization lambea.- Throws:
NullPointerException- if the provided dataSet is null.
-
-
Method Details
-
computeOLS
public static org.ejml.simple.SimpleMatrix computeOLS(org.ejml.simple.SimpleMatrix B, org.ejml.simple.SimpleMatrix X, double lambda) Deprecated.Computes the Ordinary Least Squares (OLS) solution for a linear system. The method applies regularization to the OLS problem to stabilize the solution, particularly in cases where the design matrix B is ill-conditioned or near singular. Regularization is controlled by the lambda parameter, which adds a scaled identity matrix to the design matrix's normal equation.- Parameters:
B- the design matrix, where rows correspond to observations and columns correspond to features.X- the response matrix, where rows correspond to observations and columns to dependent variable outputs.lambda- the regularization parameter used to stabilize the solution. Larger values result in stronger regularization.- Returns:
- the computed OLS solution as a SimpleMatrix object.
-
checkIndependence
Deprecated.Tests for the conditional independence of two nodes, x and y, given a set of conditioning nodes z. The method evaluates the independence using a generalized likelihood ratio test and p-value computation.- Specified by:
checkIndependencein interfaceIndependenceTest- Parameters:
x- the first Node to test for independence.y- the second Node to test for independence.z- a set of conditioning nodes; the test checks the independence of x and y conditioned on these nodes.- Returns:
- an IndependenceResult object containing the result of the independence test, including whether x and y are independent, the computed p-value, and other associated data.
-
getVariables
Deprecated.Retrieves the list of nodes (variables) associated with this instance.- Specified by:
getVariablesin interfaceIndependenceTest- Returns:
- a list of Node objects representing the variables.
-
getData
Deprecated.Retrieves the data model associated with this instance.- Specified by:
getDatain interfaceIndependenceTest- Returns:
- the current DataModel instance held by this class.
-
isVerbose
public boolean isVerbose()Deprecated.Indicates whether verbose mode is enabled. Verbose mode, when enabled, typically results in detailed logging or diagnostic information being output.- Specified by:
isVerbosein interfaceIndependenceTest- Returns:
- true if verbose mode is enabled; false otherwise.
-
setVerbose
public void setVerbose(boolean verbose) Deprecated.Sets the verbose mode for logging or output behavior. When verbose mode is enabled, detailed information about the processing can be printed or logged, depending on the implementation.- Specified by:
setVerbosein interfaceIndependenceTest- Parameters:
verbose- a boolean flag indicating whether to enable or disable verbose mode. If true, verbose mode is enabled; if false, it is disabled.
-
getAlpha
public double getAlpha()Deprecated.Returns the significance level of the independence test.- Specified by:
getAlphain interfaceIndependenceTest- Returns:
- this level, default 0.01.
-
setAlpha
public void setAlpha(double alpha) Deprecated.Sets the significance level.- Specified by:
setAlphain interfaceIndependenceTest- Parameters:
alpha- This level.
-
setLambda
public void setLambda(double lambda) Deprecated.Sets the value of the lambda parameter. This parameter is often used as a regularization term or weight in various computations within the class. The default value is 1e-10.- Parameters:
lambda- the value to set for the lambda parameter, typically a non-negative double value used to adjust the impact of regularization or weighting in statistical computations.
-
getEffectiveSampleSize
public int getEffectiveSampleSize()Deprecated.Description copied from interface:EffectiveSampleSizeSettableReturns the effective sample size.- Specified by:
getEffectiveSampleSizein interfaceEffectiveSampleSizeSettable- Returns:
- the effective sample size
-
setEffectiveSampleSize
public void setEffectiveSampleSize(int effectiveSampleSize) Deprecated.Sets the sample size to use for the independence test, which may be different from the sample size of the data set or covariance matrix. If not set, the sample size of the data set or covariance matrix is used.- Specified by:
setEffectiveSampleSizein interfaceEffectiveSampleSizeSettable- Parameters:
effectiveSampleSize- The sample size to use.
-
getRows
Deprecated.Returns the rows used in the test.- Specified by:
getRowsin interfaceRowsSettable- Returns:
- The rows used in the test.
-
setRows
Deprecated.Allows the user to set which rows are used in the test. Otherwise, all rows are used, except those with missing values.- Specified by:
setRowsin interfaceRowsSettable- Parameters:
rows- The rows to use for the test. Can be null.
-
setDoOneEquationOnly
public void setDoOneEquationOnly(boolean doOneEquationOnly) Deprecated.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. *
-