Class EquivalenceTest
- All Implemented Interfaces:
IndependenceWrapper, HasParameters, TetradSerializable, Serializable
Reports independence only when it can show the partial correlation is negligible, instead of when it fails to reject zero. An adjacency search deletes an edge on a report of independence, so with an ordinary test it deletes on the absence of evidence; the removal region |z| < c*se shrinks with the sample size, which means weak-but-real edges are deleted most eagerly at exactly the sample sizes where deleting them is least justified. Choosing this test moves the burden of proof onto removal.
Two caveats before selecting it. The margin must exceed roughly 1.645/sqrt(n) at alpha = 0.05
or nothing is removable and the search returns a complete graph, which is why
Params.EQUIVALENCE_MARGIN defaults to 0, meaning "scale the margin to the sample size".
And the test's meaning of independence is weaker than an ordinary test's meaning of dependence,
so an algorithm that asks "are these two dependent?" inside an orientation rule may be degraded
by it. For CCD, prefer Params.USE_EQUIVALENCE_REMOVAL on the algorithm, which applies
the equivalence rule to the adjacency phase alone and leaves orientation on the selected test.
- Author:
- josephramsey
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IndTestEquivalencebuild(IndTestFisherZ fisherZ, int sampleSize, double margin, double multiplier, double alpha) Builds the equivalence test from an already-constructed Fisher Z test, resolving the margin the same waygetTest(DataModel, Parameters)does.Returns the data type this test requires.Returns a short description of this test.Returns the parameters this test uses.getTest(DataModel dataModel, Parameters parameters) Builds the equivalence test for the given data and parameters.
-
Constructor Details
-
EquivalenceTest
public EquivalenceTest()Constructs a new instance of the test.
-
-
Method Details
-
getTest
Builds the equivalence test for the given data and parameters. WhenParams.EQUIVALENCE_MARGINis 0 the margin is scaled to the sample size, asParams.EQUIVALENCE_MARGIN_MULTIPLIERtimes the smallest margin that sample size could certify.- Specified by:
getTestin interfaceIndependenceWrapper- Parameters:
dataModel- the data set or covariance matrix to test independence against.parameters- the parameters of the test.- Returns:
- the equivalence test.
- Throws:
IllegalArgumentException- if the data model is neither a data set nor a covariance matrix, or the sample size is too small to be usable.
-
build
public static IndTestEquivalence build(IndTestFisherZ fisherZ, int sampleSize, double margin, double multiplier, double alpha) Builds the equivalence test from an already-constructed Fisher Z test, resolving the margin the same waygetTest(DataModel, Parameters)does. Exposed so that an algorithm applying the equivalence rule to one phase only can reuse the resolution logic.- Parameters:
fisherZ- the underlying Fisher Z test.sampleSize- the sample size the margin is scaled to when margin is 0.margin- the explicit margin, or 0 to scale it to the sample size.multiplier- the multiplier used when margin is 0.alpha- the one-sided level of each of the two tests.- Returns:
- the equivalence test.
- Throws:
IllegalArgumentException- if the sample size is too small for the automatic margin.
-
getDescription
Returns a short description of this test.- Specified by:
getDescriptionin interfaceIndependenceWrapper- Returns:
- the description.
-
getDataType
Returns the data type this test requires.- Specified by:
getDataTypein interfaceIndependenceWrapper- Returns:
- continuous data.
-
getParameters
Returns the parameters this test uses.- Specified by:
getParametersin interfaceHasParameters- Specified by:
getParametersin interfaceIndependenceWrapper- Returns:
- the parameter names.
-