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

    Constructors
    Constructor
    Description
    IndTestBasisFunctionLrtFullSample(DataSet dataSet, int truncationLimit, double lambda)
    Deprecated.
    Constructs an instance of the IndTestBasisFunctionLrt class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated.
    Tests for the conditional independence of two nodes, x and y, given a set of conditioning nodes z.
    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.
    double
    Deprecated.
    Returns the significance level of the independence test.
    Deprecated.
    Retrieves the data model associated with this instance.
    int
    Deprecated.
    Returns the effective sample size.
    Deprecated.
    Returns the rows used in the test.
    Deprecated.
    Retrieves the list of nodes (variables) associated with this instance.
    boolean
    Deprecated.
    Indicates whether verbose mode is enabled.
    void
    setAlpha(double alpha)
    Deprecated.
    Sets the significance level.
    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.
    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.
    void
    setLambda(double lambda)
    Deprecated.
    Sets the value of the lambda parameter.
    void
    Deprecated.
    Allows the user to set which rows are used in the test.
    void
    setVerbose(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, wait
  • Constructor Details

    • IndTestBasisFunctionLrtFullSample

      public IndTestBasisFunctionLrtFullSample(DataSet dataSet, int truncationLimit, double lambda)
      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

      public IndependenceResult checkIndependence(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. The method evaluates the independence using a generalized likelihood ratio test and p-value computation.
      Specified by:
      checkIndependence in interface IndependenceTest
      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

      public List<Node> getVariables()
      Deprecated.
      Retrieves the list of nodes (variables) associated with this instance.
      Specified by:
      getVariables in interface IndependenceTest
      Returns:
      a list of Node objects representing the variables.
    • getData

      public DataModel getData()
      Deprecated.
      Retrieves the data model associated with this instance.
      Specified by:
      getData in interface IndependenceTest
      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:
      isVerbose in interface IndependenceTest
      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:
      setVerbose in interface IndependenceTest
      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:
      getAlpha in interface IndependenceTest
      Returns:
      this level, default 0.01.
    • setAlpha

      public void setAlpha(double alpha)
      Deprecated.
      Sets the significance level.
      Specified by:
      setAlpha in interface IndependenceTest
      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: EffectiveSampleSizeSettable
      Returns the effective sample size.
      Specified by:
      getEffectiveSampleSize in interface EffectiveSampleSizeSettable
      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:
      setEffectiveSampleSize in interface EffectiveSampleSizeSettable
      Parameters:
      effectiveSampleSize - The sample size to use.
    • getRows

      public List<Integer> getRows()
      Deprecated.
      Returns the rows used in the test.
      Specified by:
      getRows in interface RowsSettable
      Returns:
      The rows used in the test.
    • setRows

      public void setRows(List<Integer> rows)
      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:
      setRows in interface RowsSettable
      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. *