Package edu.cmu.tetrad.search.ntad_test
Class Ark
java.lang.Object
edu.cmu.tetrad.search.ntad_test.NtadTest
edu.cmu.tetrad.search.ntad_test.Ark
The Ark class extends the NtadTest class and provides a mechanism to perform statistical operations based on tetrads
and their probabilities. It leverages correlation computation, sampling, and matrix manipulation to calculate
p-values and z-scores for tetrads. This class is specifically designed to operate on instances of SimpleMatrix for
multivariate analysis.
- Author:
- bryanandrews
-
Constructor Summary
ConstructorsConstructorDescriptionArk(org.ejml.simple.SimpleMatrix df, double sp, int ess) Constructs an Ark object using the provided data matrix, split proportion, and effective sample size. -
Method Summary
Modifier and TypeMethodDescriptiondoublentad(int[][] ntad) Computes a statistical measure using the specified indices and correlation matrices.doublentad(int[][] ntad, boolean resample, double frac) Computes a statistical measure based on the specified indices and correlation matrices.doublentads(int[][]... ntads) Computes a statistical measure based on a variable number of 2D integer arrays, where each array contains tetrad configurations.doubleComputes a statistical measure based on a list of tetrad configurations.Methods inherited from class edu.cmu.tetrad.search.ntad_test.NtadTest
allGreaterThanAlpha, variables
-
Constructor Details
-
Ark
public Ark(org.ejml.simple.SimpleMatrix df, double sp, int ess) Constructs an Ark object using the provided data matrix, split proportion, and effective sample size. The data matrix is divided into two subsets based on the specified split proportion. Correlation matrices are computed for each subset.- Parameters:
df- the input data matrix as a SimpleMatrix object, where each row represents an observation and each column represents a variablesp- the split proportion for dividing the data matrix into two subsets; values greater than 0 are used as-is, while negative values are transformed to 1 - spess- the effective sample size, which must be -1 or greater than 1
-
-
Method Details
-
ntad
public double ntad(int[][] ntad, boolean resample, double frac) Computes a statistical measure based on the specified indices and correlation matrices. Depending on the resampling flag, the method either operates on precomputed matrices or recalculates them using a sampled subset of the data matrix. This method is designed to compute a p-value reflecting the statistical significance of a correlation pattern.- Specified by:
ntadin classNtadTest- Parameters:
ntad- a 2D integer array where ntad[0] contains indices for the first group of variables, and ntad[1] contains indices for the second groupresample- a boolean indicating whether to resample the data matrix for correlation calculation; if true, a subset of rows is selected based on the specified fractionfrac- a double representing the fraction of rows to sample if resampling is enabled, where 0.0 <= frac <= 1.0- Returns:
- a double representing the p-value for the computed correlation statistics
-
ntad
public double ntad(int[][] ntad) Computes a statistical measure using the specified indices and correlation matrices. This method internally delegates to another overloaded version of the function with additional parameters set to default values. -
ntads
public double ntads(int[][]... ntads) Computes a statistical measure based on a variable number of 2D integer arrays, where each array contains tetrad configurations. This method internally delegates to another overloaded version of the function which accepts a list of tetrad configurations.- Specified by:
ntadsin classNtadTest- Parameters:
ntads- a variable-length array of 2D integer arrays, where each element represents a tetrad configuration. Each 2D array is expected to contain two subarrays, each defining a group of node indices.- Returns:
- a double value representing the computed statistical measure for the provided tetrads.
-
ntads
Computes a statistical measure based on a list of tetrad configurations. Each tetrad configuration is represented as a 2D integer array with two subarrays, where each subarray defines a group of node indices. The method calculates a combined p-value through logarithmic transformations and chi-squared distribution.- Specified by:
ntadsin classNtadTest- Parameters:
ntads- a list of 2D integer arrays, where each array represents a tetrad configuration. Each 2D array must contain exactly two subarrays with matching lengths, representing two groups of node indices.- Returns:
- a double value representing the computed statistical measure for the provided tetrads. The result is a p-value reflecting the statistical significance of the configurations.
- Throws:
IllegalArgumentException- if any tetrad does not contain exactly two subarrays or if the subarrays do not have the same length.
-