Class TetradTestDiscrete

java.lang.Object
edu.cmu.tetrad.search.utils.TetradTestDiscrete
All Implemented Interfaces:
TetradTest

public final class TetradTestDiscrete extends Object implements TetradTest
Implements a test of tetrad constraints with discrete variables. We are assuming that variables are ordinal or binary. Such tests are a core statistical procedure in algorithm BuildPureClusters and Purify. An "underlying latent variable" approach is used to test tetrads indirectly by fitting discrete one-factor and two-factor models. See Bartholomew and Knott (1999) for details. A two-stage procedure for fitting polychorics correlations (Olsson, 1979) and a chi-square test of tetrad constraints over those correlations is the key for this method. References: Bartholomew, D. and Knott, M. (1999). Latent Variable Models and Factor Analysis, 2nd edition. Arnold. Olsson, Ulf (1979). "Maximum likelihood estimation of the polychoric correlation coefficient". Psychometrika 44, 443-460. Stroud, A. and Secrest D. (1966) Gaussian Quadrature Formulas. Prentice Hall.
Version:
$Id: $Id
Author:
Ricardo Silva
  • Field Details

    • verbose

      public boolean verbose
      Whether to print out verbose information.
  • Constructor Details

    • TetradTestDiscrete

      public TetradTestDiscrete(DataSet dataSet, double sig)

      Constructor for TetradTestDiscrete.

      Parameters:
      dataSet - a DataSet object
      sig - a double
  • Method Details

    • getVarNames

      public String[] getVarNames()

      getVarNames.

      Specified by:
      getVarNames in interface TetradTest
      Returns:
      an array of String objects
    • getVariables

      public List<Node> getVariables()

      getVariables.

      Specified by:
      getVariables in interface TetradTest
      Returns:
      a List object
    • getDataSet

      public DataSet getDataSet()

      Getter for the field dataSet.

      Specified by:
      getDataSet in interface TetradTest
      Returns:
      a DataSet object
    • resetCache

      public void resetCache()

      resetCache.

    • getSignificance

      public double getSignificance()

      getSignificance.

      Specified by:
      getSignificance in interface TetradTest
      Returns:
      a double
    • setSignificance

      public void setSignificance(double sig)

      setSignificance.

      Specified by:
      setSignificance in interface TetradTest
      Parameters:
      sig - a double
    • tetradScore

      public int tetradScore(int i, int j, int k, int l)

      tetradScore.

      Specified by:
      tetradScore in interface TetradTest
      Parameters:
      i - a int
      j - a int
      k - a int
      l - a int
      Returns:
      a int
    • tetradScore1

      public boolean tetradScore1(int v1, int v2, int v3, int v4)

      tetradScore1.

      Tests the tetrad (v1, v3) x (v2, v4) = (v1, v4) x (v2, v3), and only that.

      Specified by:
      tetradScore1 in interface TetradTest
      Parameters:
      v1 - a int
      v2 - a int
      v3 - a int
      v4 - a int
      Returns:
      a boolean
    • tetradScore3

      public boolean tetradScore3(int v1, int v2, int v3, int v4)

      tetradScore3.

      Tests if all tetrad constraints hold

      Specified by:
      tetradScore3 in interface TetradTest
      Parameters:
      v1 - a int
      v2 - a int
      v3 - a int
      v4 - a int
      Returns:
      a boolean
    • tetradPValue

      public double tetradPValue(int v1, int v2, int v3, int v4)

      tetradPValue.

      Specified by:
      tetradPValue in interface TetradTest
      Parameters:
      v1 - a int
      v2 - a int
      v3 - a int
      v4 - a int
      Returns:
      a double
    • tetradHolds

      public boolean tetradHolds(int i, int j, int k, int l)

      tetradHolds.

      Specified by:
      tetradHolds in interface TetradTest
      Parameters:
      i - a int
      j - a int
      k - a int
      l - a int
      Returns:
      a boolean
    • oneFactorTest

      public boolean oneFactorTest(int i, int j, int k, int l)

      oneFactorTest.

      Specified by:
      oneFactorTest in interface TetradTest
      Parameters:
      i - a int
      j - a int
      k - a int
      l - a int
      Returns:
      a boolean
    • oneFactorTest

      public boolean oneFactorTest(int i, int j, int k, int l, int x)

      oneFactorTest.

      Specified by:
      oneFactorTest in interface TetradTest
      Parameters:
      i - a int
      j - a int
      k - a int
      l - a int
      x - a int
      Returns:
      a boolean
    • twoFactorTest

      public boolean twoFactorTest(int i, int j, int k, int l)

      twoFactorTest.

      Specified by:
      twoFactorTest in interface TetradTest
      Parameters:
      i - a int
      j - a int
      k - a int
      l - a int
      Returns:
      a boolean
    • twoFactorTest

      public boolean twoFactorTest(int i, int j, int k, int l, int x)

      twoFactorTest.

      Specified by:
      twoFactorTest in interface TetradTest
      Parameters:
      i - a int
      j - a int
      k - a int
      l - a int
      x - a int
      Returns:
      a boolean
    • twoFactorTest

      public boolean twoFactorTest(int i, int j, int k, int l, int x, int y)

      twoFactorTest.

      Specified by:
      twoFactorTest in interface TetradTest
      Parameters:
      i - a int
      j - a int
      k - a int
      l - a int
      x - a int
      y - a int
      Returns:
      a boolean
    • getCovMatrix

      public ICovarianceMatrix getCovMatrix()

      getCovMatrix.

      Specified by:
      getCovMatrix in interface TetradTest
      Returns:
      a ICovarianceMatrix object