Class PooledDgLrtTest
- All Implemented Interfaces:
IndependenceTest
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
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionPooledDgLrtTest(List<DataSet> imputed, double alpha, PooledDgLrtTest.Pooling pooling) Constructs the pooled test over completed datasets. -
Method Summary
Modifier and TypeMethodDescriptioncheckIndependence(Node x, Node y, Set<Node> z) Checks the independence between two variables x and y given a conditioning set z.doublegetAlpha()Returns the significance level of the independence test.getData()Retrieves the data model associated with this test.Retrieves the list of variables associated with this independence test.booleanReturns true if the test prints verbose output.voidsetAlpha(double alpha) Sets the significance level.voidsetVerbose(boolean verbose) Sets whether this test will print verbose output.toString()Returns a string representation of this test.Methods inherited from interface IndependenceTest
canBeSubsampled, checkIndependence, determines, getCov, getDataSets, getMissingValueSupport, getSampleSize, getVariable, getVariableNames, indTestSubset, isPValueAProbability
-
Constructor Details
-
PooledDgLrtTest
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
Description copied from interface:IndependenceTestChecks the independence between two variables x and y given a conditioning set z.- Specified by:
checkIndependencein interfaceIndependenceTest- 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
Description copied from interface:IndependenceTestRetrieves the list of variables associated with this independence test.- Specified by:
getVariablesin interfaceIndependenceTest- Returns:
- A list of
Nodeobjects representing the variables.
-
getData
Description copied from interface:IndependenceTestRetrieves the data model associated with this test.- Specified by:
getDatain interfaceIndependenceTest- Returns:
- A
DataModelobject representing the data model.
-
getAlpha
public double getAlpha()Description copied from interface:IndependenceTestReturns the significance level of the independence test.- Specified by:
getAlphain interfaceIndependenceTest- Returns:
- This level.
-
setAlpha
public void setAlpha(double alpha) Description copied from interface:IndependenceTestSets the significance level.- Specified by:
setAlphain interfaceIndependenceTest- Parameters:
alpha- This level.
-
isVerbose
public boolean isVerbose()Description copied from interface:IndependenceTestReturns true if the test prints verbose output.- Specified by:
isVerbosein interfaceIndependenceTest- Returns:
- True if the case.
-
setVerbose
public void setVerbose(boolean verbose) Description copied from interface:IndependenceTestSets whether this test will print verbose output.- Specified by:
setVerbosein interfaceIndependenceTest- Parameters:
verbose- True, if so.
-
toString
Description copied from interface:IndependenceTestReturns a string representation of this test.- Specified by:
toStringin interfaceIndependenceTest- Overrides:
toStringin classObject- Returns:
- This string.
-