Class PooledDgLrtTest

java.lang.Object
edu.cmu.tetrad.study.missingness.PooledDgLrtTest
All Implemented Interfaces:
IndependenceTest

public final class PooledDgLrtTest extends Object implements IndependenceTest
Degenerate-Gaussian likelihood-ratio conditional-independence testing under multiple imputation, pooled by the rules for likelihood-ratio statistics: Meng and Rubin (1992) ("D3", the default, which is what the micd package Witte et al. used implements for its tests), or Li, Meng, Raghunathan and Rubin (1991) ("D2", which pools only the per-imputation chi-square statistics and is included for comparison, being simpler but documented to lose power when the fraction of missing information is large).

The per-imputation statistic mirrors IndTestDegenerateGaussianLrt on complete data exactly: each variable is embedded (a continuous variable as itself, a discrete variable with C categories as C - 1 indicators), and the statistic for X indep Y given Z is n log(sigma0^2 / sigma1^2), where sigma^2 is the trace of the residual covariance of X's embedded block regressed on the predictors' embedded block, divided by the block size, referred to chi-square with df = the number of Y's embedded columns. D3 additionally needs the statistic evaluated at POOLED parameters: the regression coefficient matrices are averaged across imputations and the residual variance each pooled fit achieves is evaluated on every imputation's covariance by the full quadratic form (the trace shortcut holds only at a dataset's own least-squares solution). Intercepts are profiled out by per-dataset centering rather than pooled, a simplification inside the DG working model.

Caveats inherited and introduced: the pooled "likelihood ratio" is the DG working-model ratio on embedded indicators, so Meng-Rubin's guarantees extend only as far as the DG approximation itself; and the base test's asymmetry in X and Y (X's residual block, Y's degrees of freedom) is replicated, not fixed. The m completed datasets must share variables and row count.

Author:
josephramsey
  • Constructor Details

    • PooledDgLrtTest

      public PooledDgLrtTest(List<DataSet> imputed, double alpha, PooledDgLrtTest.Pooling pooling)
      Constructs the pooled test over completed datasets.
      Parameters:
      imputed - The m completed datasets, sharing variables and row count.
      alpha - The significance cutoff.
      pooling - The pooling rule; D3 unless there is a reason otherwise.
  • Method Details

    • checkIndependence

      public IndependenceResult checkIndependence(Node x, Node y, Set<Node> z)
      Description copied from interface: IndependenceTest
      Checks the independence between two variables x and y given a conditioning set z.
      Specified by:
      checkIndependence in interface IndependenceTest
      Parameters:
      x - The first variable to test, represented as a Node object.
      y - The second variable to test, represented as a Node object.
      z - The set of conditioning variables, represented as a Set of Node objects.
      Returns:
      An IndependenceResult object representing the outcome of the independence test.
    • getVariables

      public List<Node> getVariables()
      Description copied from interface: IndependenceTest
      Retrieves the list of variables associated with this independence test.
      Specified by:
      getVariables in interface IndependenceTest
      Returns:
      A list of Node objects representing the variables.
    • getData

      public DataSet getData()
      Description copied from interface: IndependenceTest
      Retrieves the data model associated with this test.
      Specified by:
      getData in interface IndependenceTest
      Returns:
      A DataModel object representing the data model.
    • getAlpha

      public double getAlpha()
      Description copied from interface: IndependenceTest
      Returns the significance level of the independence test.
      Specified by:
      getAlpha in interface IndependenceTest
      Returns:
      This level.
    • setAlpha

      public void setAlpha(double alpha)
      Description copied from interface: IndependenceTest
      Sets the significance level.
      Specified by:
      setAlpha in interface IndependenceTest
      Parameters:
      alpha - This level.
    • isVerbose

      public boolean isVerbose()
      Description copied from interface: IndependenceTest
      Returns true if the test prints verbose output.
      Specified by:
      isVerbose in interface IndependenceTest
      Returns:
      True if the case.
    • setVerbose

      public void setVerbose(boolean verbose)
      Description copied from interface: IndependenceTest
      Sets whether this test will print verbose output.
      Specified by:
      setVerbose in interface IndependenceTest
      Parameters:
      verbose - True, if so.
    • toString

      public String toString()
      Description copied from interface: IndependenceTest
      Returns a string representation of this test.
      Specified by:
      toString in interface IndependenceTest
      Overrides:
      toString in class Object
      Returns:
      This string.