Package edu.cmu.tetrad.search.utils
Class TetradTestDiscrete
java.lang.Object
edu.cmu.tetrad.search.utils.TetradTestDiscrete
- All Implemented Interfaces:
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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTetradTestDiscrete
(DataSet dataSet, double sig) Constructor for TetradTestDiscrete. -
Method Summary
Modifier and TypeMethodDescriptiongetCovMatrix.Getter for the fielddataSet
.double
getSignificance.getVariables.String[]
getVarNames.boolean
oneFactorTest
(int i, int j, int k, int l) oneFactorTest.boolean
oneFactorTest
(int i, int j, int k, int l, int x) oneFactorTest.void
resetCache.void
setSignificance
(double sig) setSignificance.boolean
tetradHolds
(int i, int j, int k, int l) tetradHolds.double
tetradPValue
(int v1, int v2, int v3, int v4) tetradPValue.int
tetradScore
(int i, int j, int k, int l) tetradScore.boolean
tetradScore1
(int v1, int v2, int v3, int v4) tetradScore1.boolean
tetradScore3
(int v1, int v2, int v3, int v4) tetradScore3.boolean
twoFactorTest
(int i, int j, int k, int l) twoFactorTest.boolean
twoFactorTest
(int i, int j, int k, int l, int x) twoFactorTest.boolean
twoFactorTest
(int i, int j, int k, int l, int x, int y) twoFactorTest.
-
Field Details
-
verbose
public boolean verboseWhether to print out verbose information.
-
-
Constructor Details
-
TetradTestDiscrete
-
-
Method Details
-
getVarNames
getVarNames.
- Specified by:
getVarNames
in interfaceTetradTest
- Returns:
- an array of
String
objects
-
getVariables
getVariables.
- Specified by:
getVariables
in interfaceTetradTest
- Returns:
- a
List
object
-
getDataSet
Getter for the field
dataSet
.- Specified by:
getDataSet
in interfaceTetradTest
- Returns:
- a
DataSet
object
-
resetCache
public void resetCache()resetCache.
-
getSignificance
public double getSignificance()getSignificance.
- Specified by:
getSignificance
in interfaceTetradTest
- Returns:
- a double
-
setSignificance
public void setSignificance(double sig) setSignificance.
- Specified by:
setSignificance
in interfaceTetradTest
- Parameters:
sig
- a double
-
tetradScore
public int tetradScore(int i, int j, int k, int l) tetradScore.
- Specified by:
tetradScore
in interfaceTetradTest
- Parameters:
i
- a intj
- a intk
- a intl
- 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 interfaceTetradTest
- Parameters:
v1
- a intv2
- a intv3
- a intv4
- 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 interfaceTetradTest
- Parameters:
v1
- a intv2
- a intv3
- a intv4
- a int- Returns:
- a boolean
-
tetradPValue
public double tetradPValue(int v1, int v2, int v3, int v4) tetradPValue.
- Specified by:
tetradPValue
in interfaceTetradTest
- Parameters:
v1
- a intv2
- a intv3
- a intv4
- a int- Returns:
- a double
-
tetradHolds
public boolean tetradHolds(int i, int j, int k, int l) tetradHolds.
- Specified by:
tetradHolds
in interfaceTetradTest
- Parameters:
i
- a intj
- a intk
- a intl
- a int- Returns:
- a boolean
-
oneFactorTest
public boolean oneFactorTest(int i, int j, int k, int l) oneFactorTest.
- Specified by:
oneFactorTest
in interfaceTetradTest
- Parameters:
i
- a intj
- a intk
- a intl
- a int- Returns:
- a boolean
-
oneFactorTest
public boolean oneFactorTest(int i, int j, int k, int l, int x) oneFactorTest.
- Specified by:
oneFactorTest
in interfaceTetradTest
- Parameters:
i
- a intj
- a intk
- a intl
- a intx
- a int- Returns:
- a boolean
-
twoFactorTest
public boolean twoFactorTest(int i, int j, int k, int l) twoFactorTest.
- Specified by:
twoFactorTest
in interfaceTetradTest
- Parameters:
i
- a intj
- a intk
- a intl
- a int- Returns:
- a boolean
-
twoFactorTest
public boolean twoFactorTest(int i, int j, int k, int l, int x) twoFactorTest.
- Specified by:
twoFactorTest
in interfaceTetradTest
- Parameters:
i
- a intj
- a intk
- a intl
- a intx
- 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 interfaceTetradTest
- Parameters:
i
- a intj
- a intk
- a intl
- a intx
- a inty
- a int- Returns:
- a boolean
-
getCovMatrix
getCovMatrix.
- Specified by:
getCovMatrix
in interfaceTetradTest
- Returns:
- a
ICovarianceMatrix
object
-